From 5ac0df4b4b3d482be239557461206132d3b33cb6 Mon Sep 17 00:00:00 2001 From: Bart Sopers Date: Sun, 1 Sep 2019 22:54:59 +0200 Subject: [PATCH 01/10] Introduce AapsOmnipodManager to match OmnipodCommunicationManagerInterface interface --- .../pump/omnipod/AapsOmnipodManager.java | 125 ++++++++++++++++++ .../plugins/pump/omnipod/OmnipodManager.java | 42 +----- .../pump/omnipod/OmnipodPumpPlugin.java | 2 +- .../OmnipodCommunicationManagerInterface.java | 9 +- .../service/RileyLinkOmnipodService.java | 12 +- 5 files changed, 134 insertions(+), 56 deletions(-) create mode 100644 app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/AapsOmnipodManager.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/AapsOmnipodManager.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/AapsOmnipodManager.java new file mode 100644 index 0000000000..09f5c74668 --- /dev/null +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/AapsOmnipodManager.java @@ -0,0 +1,125 @@ +package info.nightscout.androidaps.plugins.pump.omnipod; + +import org.joda.time.DateTime; + +import info.nightscout.androidaps.data.Profile; +import info.nightscout.androidaps.data.PumpEnactResult; +import info.nightscout.androidaps.plugins.pump.common.data.TempBasalPair; +import info.nightscout.androidaps.plugins.pump.omnipod.comm.OmnipodCommunicationService; +import info.nightscout.androidaps.plugins.pump.omnipod.defs.OmnipodCommunicationManagerInterface; +import info.nightscout.androidaps.plugins.pump.omnipod.defs.PodInfoType; +import info.nightscout.androidaps.plugins.pump.omnipod.defs.PodInitActionType; +import info.nightscout.androidaps.plugins.pump.omnipod.defs.PodInitReceiver; +import info.nightscout.androidaps.plugins.pump.omnipod.defs.state.PodSessionState; + +public class AapsOmnipodManager implements OmnipodCommunicationManagerInterface { + private final OmnipodManager delegate; + + private static AapsOmnipodManager instance; + + // FIXME this is dirty + public static AapsOmnipodManager getInstance() { + return instance; + } + + public AapsOmnipodManager(OmnipodCommunicationService communicationService, PodSessionState podState) { + delegate = new OmnipodManager(communicationService, podState); + instance = this; + } + + @Override + public PumpEnactResult initPod(PodInitActionType podInitActionType, PodInitReceiver podInitReceiver) { + if (PodInitActionType.PairAndPrimeWizardStep.equals(podInitActionType)) { + PumpEnactResult result = delegate.pairAndPrime(); + podInitReceiver.returnInitTaskStatus(podInitActionType, result.success, (result.success ? null : result.comment)); + return result; + } else if(PodInitActionType.FillCannulaWizardStep.equals(podInitActionType)) { + // FIXME we need a basal profile here + PumpEnactResult result = delegate.insertCannula(null); + podInitReceiver.returnInitTaskStatus(podInitActionType, result.success, (result.success ? null : result.comment)); + return result; + } + return new PumpEnactResult().success(false).enacted(false).comment("Illegal PodInitActionType: "+ podInitActionType.name()); + } + + @Override + public PumpEnactResult getPodStatus() { + return delegate.getPodStatus(); + } + + @Override + public PumpEnactResult deactivatePod() { + return delegate.deactivatePod(); + } + + @Override + public PumpEnactResult setBasalProfile(Profile basalProfile) { + return delegate.setBasalProfile(basalProfile); + } + + @Override + public PumpEnactResult resetPodStatus() { + return delegate.resetPodState(); + } + + @Override + public PumpEnactResult setBolus(Double amount) { + return delegate.bolus(amount); + } + + @Override + public PumpEnactResult cancelBolus() { + return delegate.cancelBolus(); + } + + @Override + public PumpEnactResult setTemporaryBasal(TempBasalPair tempBasalPair) { + return delegate.setTemporaryBasal(tempBasalPair); + } + + @Override + public PumpEnactResult cancelTemporaryBasal() { + return delegate.cancelTemporaryBasal(); + } + + @Override + public PumpEnactResult acknowledgeAlerts() { + return delegate.acknowledgeAlerts(); + } + + // TODO should we add this to the OmnipodCommunicationManager interface? + public PumpEnactResult getPodInfo(PodInfoType podInfoType) { + return delegate.getPodInfo(podInfoType); + } + + // TODO should we add this to the OmnipodCommunicationManager interface? + public PumpEnactResult suspendDelivery() { + return delegate.suspendDelivery(); + } + + // TODO should we add this to the OmnipodCommunicationManager interface? + public PumpEnactResult resumeDelivery() { + return delegate.resumeDelivery(); + } + + // TODO should we add this to the OmnipodCommunicationManager interface? + public PumpEnactResult setTime() { + return delegate.setTime(); + } + + public OmnipodCommunicationService getCommunicationService() { + return delegate.getCommunicationService(); + } + + public DateTime getTime() { + return delegate.getTime(); + } + + public boolean isInitialized() { + return delegate.isInitialized(); + } + + public String getPodStateAsString() { + return delegate.getPodStateAsString(); + } +} diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodManager.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodManager.java index b95a35b07b..200512b121 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodManager.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodManager.java @@ -32,25 +32,16 @@ import info.nightscout.androidaps.plugins.pump.omnipod.comm.action.service.SetTe import info.nightscout.androidaps.plugins.pump.omnipod.comm.message.response.StatusResponse; import info.nightscout.androidaps.plugins.pump.omnipod.comm.message.response.podinfo.PodInfoResponse; import info.nightscout.androidaps.plugins.pump.omnipod.defs.DeliveryType; -import info.nightscout.androidaps.plugins.pump.omnipod.defs.OmnipodCommunicationManagerInterface; import info.nightscout.androidaps.plugins.pump.omnipod.defs.PodInfoType; -import info.nightscout.androidaps.plugins.pump.omnipod.defs.PodInitActionType; -import info.nightscout.androidaps.plugins.pump.omnipod.defs.PodInitReceiver; import info.nightscout.androidaps.plugins.pump.omnipod.defs.SetupProgress; import info.nightscout.androidaps.plugins.pump.omnipod.defs.schedule.BasalScheduleMapper; import info.nightscout.androidaps.plugins.pump.omnipod.defs.state.PodSessionState; import info.nightscout.androidaps.plugins.pump.omnipod.util.OmnipodConst; import info.nightscout.androidaps.utils.SP; -public class OmnipodManager implements OmnipodCommunicationManagerInterface { +public class OmnipodManager { private final OmnipodCommunicationService communicationService; private PodSessionState podState; - private static OmnipodManager instance; - - // FIXME this is dirty - public static OmnipodManager getInstance() { - return instance; - } public OmnipodManager(OmnipodCommunicationService communicationService, PodSessionState podState) { if (communicationService == null) { @@ -58,10 +49,8 @@ public class OmnipodManager implements OmnipodCommunicationManagerInterface { } this.communicationService = communicationService; this.podState = podState; - instance = this; } - public PumpEnactResult insertCannula(Profile profile) { if (podState == null || podState.getSetupProgress().isBefore(SetupProgress.PRIMING_FINISHED)) { // TODO use string resource @@ -88,7 +77,6 @@ public class OmnipodManager implements OmnipodCommunicationManagerInterface { return new PumpEnactResult().success(true).enacted(true); } - public PumpEnactResult pairAndPrime() { try { if (podState == null) { @@ -114,7 +102,6 @@ public class OmnipodManager implements OmnipodCommunicationManagerInterface { return new PumpEnactResult().success(true).enacted(true); } - @Override public PumpEnactResult cancelBolus() { if (!isInitialized()) { return createNotInitializedResult(); @@ -131,12 +118,6 @@ public class OmnipodManager implements OmnipodCommunicationManagerInterface { return new PumpEnactResult().success(true).enacted(true); } - @Override - public PumpEnactResult initPod(PodInitActionType podInitActionType, PodInitReceiver podIniReceiver) { - return null; - } - - @Override public PumpEnactResult getPodStatus() { if (podState == null) { // TODO use string resource @@ -155,7 +136,6 @@ public class OmnipodManager implements OmnipodCommunicationManagerInterface { return new PumpEnactResult().success(true).enacted(true); } - @Override public PumpEnactResult deactivatePod() { if (podState == null) { // TODO use string resource @@ -174,7 +154,6 @@ public class OmnipodManager implements OmnipodCommunicationManagerInterface { return new PumpEnactResult().success(true).enacted(true); } - @Override public PumpEnactResult setBasalProfile(Profile basalProfile) { if (!isInitialized()) { return createNotInitializedResult(); @@ -193,18 +172,6 @@ public class OmnipodManager implements OmnipodCommunicationManagerInterface { return new PumpEnactResult().success(true).enacted(true); } - @Override - public PumpEnactResult resetPodStatus() { - return null; - } - - @Override - public PumpEnactResult setBolus(Double amount) { - return null; - } - - - // TODO rename back public PumpEnactResult resetPodState() { podState = null; SP.remove(OmnipodConst.Prefs.PodState); @@ -212,7 +179,6 @@ public class OmnipodManager implements OmnipodCommunicationManagerInterface { return new PumpEnactResult().success(true).enacted(true); } - // TODO rename back public PumpEnactResult bolus(Double units) { if (!isInitialized()) { return createNotInitializedResult(); @@ -229,7 +195,6 @@ public class OmnipodManager implements OmnipodCommunicationManagerInterface { return new PumpEnactResult().success(true).enacted(true); } - @Override public PumpEnactResult setTemporaryBasal(TempBasalPair tempBasalPair) { if (!isInitialized()) { return createNotInitializedResult(); @@ -248,7 +213,6 @@ public class OmnipodManager implements OmnipodCommunicationManagerInterface { return new PumpEnactResult().success(true).enacted(true); } - @Override public PumpEnactResult cancelTemporaryBasal() { if (!isInitialized()) { return createNotInitializedResult(); @@ -265,7 +229,6 @@ public class OmnipodManager implements OmnipodCommunicationManagerInterface { return new PumpEnactResult().success(true).enacted(true); } - @Override public PumpEnactResult acknowledgeAlerts() { if (!isInitialized()) { return createNotInitializedResult(); @@ -299,7 +262,6 @@ public class OmnipodManager implements OmnipodCommunicationManagerInterface { return new PumpEnactResult().success(true).enacted(true); } - // TODO should we add this to the OmnipodCommunicationManager interface? public PumpEnactResult suspendDelivery() { if (!isInitialized()) { return createNotInitializedResult(); @@ -316,7 +278,6 @@ public class OmnipodManager implements OmnipodCommunicationManagerInterface { return new PumpEnactResult().success(true).enacted(true); } - // TODO should we add this to the OmnipodCommunicationManager interface? public PumpEnactResult resumeDelivery() { if (!isInitialized()) { return createNotInitializedResult(); @@ -334,7 +295,6 @@ public class OmnipodManager implements OmnipodCommunicationManagerInterface { return new PumpEnactResult().success(true).enacted(true); } - // TODO should we add this to the OmnipodCommunicationManager interface? public PumpEnactResult setTime() { if (!isInitialized()) { return createNotInitializedResult(); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodPumpPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodPumpPlugin.java index d813717015..88f928d10e 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodPumpPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodPumpPlugin.java @@ -109,7 +109,7 @@ public class OmnipodPumpPlugin extends PumpPluginAbstract implements OmnipodPump OmnipodUtil.setOmnipodPodType(OmnipodPodType.Eros); if (omnipodCommunicationManager == null) { - omnipodCommunicationManager = OmnipodManager.getInstance(); + omnipodCommunicationManager = AapsOmnipodManager.getInstance(); } omnipodUIComm = new OmnipodUIComm(omnipodCommunicationManager); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/defs/OmnipodCommunicationManagerInterface.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/defs/OmnipodCommunicationManagerInterface.java index 937bc53623..8780b69b17 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/defs/OmnipodCommunicationManagerInterface.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/defs/OmnipodCommunicationManagerInterface.java @@ -11,14 +11,7 @@ public interface OmnipodCommunicationManagerInterface { /** * Initialize Pod */ - PumpEnactResult initPod(PodInitActionType podInitActionType, PodInitReceiver podIniReceiver); - - // TODO remove - //PumpEnactResult pairAndPrime(); - - // TODO remove - //PumpEnactResult insertCannula(Profile basalProfile); - + PumpEnactResult initPod(PodInitActionType podInitActionType, PodInitReceiver podInitReceiver); /** * Get Pod Status (is pod running, battery left ?, reservoir, etc) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/service/RileyLinkOmnipodService.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/service/RileyLinkOmnipodService.java index 584d3bc1f8..cd70a9c7cd 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/service/RileyLinkOmnipodService.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/service/RileyLinkOmnipodService.java @@ -23,7 +23,7 @@ import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLin import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkTargetDevice; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.RileyLinkService; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.RileyLinkServiceData; -import info.nightscout.androidaps.plugins.pump.omnipod.OmnipodManager; +import info.nightscout.androidaps.plugins.pump.omnipod.AapsOmnipodManager; import info.nightscout.androidaps.plugins.pump.omnipod.OmnipodPumpPlugin; import info.nightscout.androidaps.plugins.pump.omnipod.comm.OmnipodCommunicationService; import info.nightscout.androidaps.plugins.pump.omnipod.defs.OmnipodCommunicationManagerInterface; @@ -112,7 +112,7 @@ public class RileyLinkOmnipodService extends RileyLinkService { } private void initializeErosOmnipodManager() { - if(OmnipodManager.getInstance() == null) { + if(AapsOmnipodManager.getInstance() == null) { PodSessionState podState = null; if (SP.contains(OmnipodConst.Prefs.PodState)) { try { @@ -123,9 +123,9 @@ public class RileyLinkOmnipodService extends RileyLinkService { LOG.error("Could not deserialize Pod state: " + ex.getClass().getSimpleName() + ": " + ex.getMessage()); } } - omnipodCommunicationManager = new OmnipodManager(new OmnipodCommunicationService(rfspy), podState); + omnipodCommunicationManager = new AapsOmnipodManager(new OmnipodCommunicationService(rfspy), podState); } else { - omnipodCommunicationManager = OmnipodManager.getInstance(); + omnipodCommunicationManager = AapsOmnipodManager.getInstance(); } } @@ -137,8 +137,8 @@ public class RileyLinkOmnipodService extends RileyLinkService { @Override public RileyLinkCommunicationManager getDeviceCommunicationManager() { - if(omnipodCommunicationManager instanceof OmnipodManager) { // Eros - return ((OmnipodManager) omnipodCommunicationManager).getCommunicationService(); + if(omnipodCommunicationManager instanceof AapsOmnipodManager) { // Eros + return ((AapsOmnipodManager) omnipodCommunicationManager).getCommunicationService(); } // FIXME is this correct for Dash? return (RileyLinkCommunicationManager)omnipodCommunicationManager; From d14789cf029b4506c5d54821f2ec4be0be6a1a40 Mon Sep 17 00:00:00 2001 From: Bart Sopers Date: Sun, 1 Sep 2019 23:30:11 +0200 Subject: [PATCH 02/10] Apply new understandings of beep types --- .../message/command/BeepConfigCommand.java | 8 ++-- .../pump/omnipod/defs/BeepConfigType.java | 41 +++++++++++++++++++ .../plugins/pump/omnipod/defs/BeepType.java | 8 +--- .../comm/action/service/PairServiceTest.java | 4 +- .../command/BeepConfigCommandTest.java | 6 +-- .../message/response/StatusResponseTest.java | 6 +-- 6 files changed, 55 insertions(+), 18 deletions(-) create mode 100644 app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/defs/BeepConfigType.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/command/BeepConfigCommand.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/command/BeepConfigCommand.java index 6e77a7f5d1..09c1290d1f 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/command/BeepConfigCommand.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/command/BeepConfigCommand.java @@ -4,11 +4,11 @@ import org.joda.time.Duration; import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; import info.nightscout.androidaps.plugins.pump.omnipod.comm.message.MessageBlock; -import info.nightscout.androidaps.plugins.pump.omnipod.defs.BeepType; +import info.nightscout.androidaps.plugins.pump.omnipod.defs.BeepConfigType; import info.nightscout.androidaps.plugins.pump.omnipod.defs.MessageBlockType; public class BeepConfigCommand extends MessageBlock { - private final BeepType beepType; + private final BeepConfigType beepType; private final boolean basalCompletionBeep; private final Duration basalIntervalBeep; private final boolean tempBasalCompletionBeep; @@ -16,7 +16,7 @@ public class BeepConfigCommand extends MessageBlock { private final boolean bolusCompletionBeep; private final Duration bolusIntervalBeep; - public BeepConfigCommand(BeepType beepType, boolean basalCompletionBeep, Duration basalIntervalBeep, + public BeepConfigCommand(BeepConfigType beepType, boolean basalCompletionBeep, Duration basalIntervalBeep, boolean tempBasalCompletionBeep, Duration tempBasalIntervalBeep, boolean bolusCompletionBeep, Duration bolusIntervalBeep) { this.beepType = beepType; @@ -30,7 +30,7 @@ public class BeepConfigCommand extends MessageBlock { encode(); } - public BeepConfigCommand(BeepType beepType) { + public BeepConfigCommand(BeepConfigType beepType) { this(beepType, false, Duration.ZERO, false, Duration.ZERO, false, Duration.ZERO); } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/defs/BeepConfigType.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/defs/BeepConfigType.java new file mode 100644 index 0000000000..3ef731e5c8 --- /dev/null +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/defs/BeepConfigType.java @@ -0,0 +1,41 @@ +package info.nightscout.androidaps.plugins.pump.omnipod.defs; + + +// BeepConfigType is used only for the $1E Beep Config Command. +public enum BeepConfigType { + // 0x0 always returns an error response for Beep Config (use 0xF for no beep) + BEEP_BEEP_BEEP_BEEP((byte) 0x01), + BIP_BEEP_BIP_BEEP_BIP_BEEP_BIP_BEEP((byte) 0x02), + BIP_BIP((byte) 0x03), + BEEP((byte) 0x04), + BEEP_BEEP_BEEP((byte) 0x05), + BEEEEEEP((byte) 0x06), + BIP_BIP_BIP_BIP_BIP_BIP((byte) 0x07), + BEEEP_BEEEP((byte) 0x08), + // 0x9 and 0xA always return an error response for Beep Config + BEEP_BEEP((byte) 0xB), + BEEEP((byte) 0xC), + BIP_BEEEEEP((byte) 0xD), + FIVE_SECONDS_BEEP((byte) 0xE), // can only be used if Pod is currently suspended + NO_BEEP((byte) 0xF); + + private byte value; + + BeepConfigType(byte value) { + this.value = value; + } + + public static BeepConfigType fromByte(byte value) { + for (BeepConfigType type : values()) { + if (type.value == value) { + return type; + } + } + throw new IllegalArgumentException("Unknown BeepConfigType: " + value); + } + + public byte getValue() { + return value; + } + +} diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/defs/BeepType.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/defs/BeepType.java index 7cf08b8714..e230276467 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/defs/BeepType.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/defs/BeepType.java @@ -1,5 +1,6 @@ package info.nightscout.androidaps.plugins.pump.omnipod.defs; +// BeepType is used for the $19 Configure Alerts and $1F Cancel Commands public enum BeepType { NO_BEEP((byte) 0x00), BEEP_BEEP_BEEP_BEEP((byte) 0x01), @@ -9,12 +10,7 @@ public enum BeepType { BEEP_BEEP_BEEP((byte) 0x05), BEEEEEEP((byte) 0x06), BIP_BIP_BIP_BIP_BIP_BIP((byte) 0x07), - BEEEP_BEEEP((byte) 0x08), - BEEP_BEEP((byte) 0xB), - BEEEP((byte) 0xC), - BIP_BEEEEEP((byte) 0xD), - FIVE_SECONDS_BEEP((byte) 0xE), - BEEP_CONFIG_NO_BEEP((byte) 0xF); + BEEEP_BEEEP((byte) 0x08); private byte value; diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/action/service/PairServiceTest.java b/app/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/action/service/PairServiceTest.java index fe7773ff7b..4800d38ee2 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/action/service/PairServiceTest.java +++ b/app/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/action/service/PairServiceTest.java @@ -7,12 +7,12 @@ import org.mockito.ArgumentCaptor; import org.mockito.Mock; import org.mockito.junit.MockitoJUnitRunner; -import info.nightscout.androidaps.Constants; import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; import info.nightscout.androidaps.plugins.pump.omnipod.comm.OmnipodCommunicationService; import info.nightscout.androidaps.plugins.pump.omnipod.comm.message.OmnipodMessage; import info.nightscout.androidaps.plugins.pump.omnipod.comm.message.response.VersionResponse; import info.nightscout.androidaps.plugins.pump.omnipod.defs.state.PodSetupState; +import info.nightscout.androidaps.plugins.pump.omnipod.util.OmnipodConst; import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; @@ -47,7 +47,7 @@ public class PairServiceTest { VersionResponse versionResponse = new PairService().executeAssignAddressCommand(communicationService, setupState); // verify - verify(communicationService).exchangeMessages(eq(VersionResponse.class), eq(setupState), messageCaptor.capture(), eq(Constants.DEFAULT_ADDRESS), eq(0x1f173217)); + verify(communicationService).exchangeMessages(eq(VersionResponse.class), eq(setupState), messageCaptor.capture(), eq(OmnipodConst.DEFAULT_ADDRESS), eq(0x1f173217)); verifyNoMoreInteractions(communicationService); verifyZeroInteractions(response); diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/command/BeepConfigCommandTest.java b/app/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/command/BeepConfigCommandTest.java index fc04d3f6c8..5435e477d7 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/command/BeepConfigCommandTest.java +++ b/app/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/command/BeepConfigCommandTest.java @@ -4,14 +4,14 @@ import org.joda.time.Duration; import org.junit.Test; import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; -import info.nightscout.androidaps.plugins.pump.omnipod.defs.BeepType; +import info.nightscout.androidaps.plugins.pump.omnipod.defs.BeepConfigType; import static org.junit.Assert.assertArrayEquals; public class BeepConfigCommandTest { @Test public void testConfidenceReminders() { - BeepConfigCommand beepConfigCommand = new BeepConfigCommand(BeepType.BIP_BEEP_BIP_BEEP_BIP_BEEP_BIP_BEEP, true, + BeepConfigCommand beepConfigCommand = new BeepConfigCommand(BeepConfigType.BIP_BEEP_BIP_BEEP_BIP_BEEP_BIP_BEEP, true, Duration.ZERO, true, Duration.ZERO, true, Duration.ZERO); assertArrayEquals(ByteUtil.fromHexString("1e0402404040"), beepConfigCommand.getRawData()); @@ -19,7 +19,7 @@ public class BeepConfigCommandTest { @Test public void testProgramReminders() { - BeepConfigCommand beepConfigCommand = new BeepConfigCommand(BeepType.BEEP_CONFIG_NO_BEEP, true, + BeepConfigCommand beepConfigCommand = new BeepConfigCommand(BeepConfigType.NO_BEEP, true, Duration.ZERO, false, Duration.standardMinutes(60), false, Duration.standardMinutes(60)); assertArrayEquals(ByteUtil.fromHexString("1e040f403c3c"), beepConfigCommand.getRawData()); diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/StatusResponseTest.java b/app/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/StatusResponseTest.java index 6ac202622a..2c74ed1f74 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/StatusResponseTest.java +++ b/app/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/StatusResponseTest.java @@ -3,10 +3,10 @@ package info.nightscout.androidaps.plugins.pump.omnipod.comm.message.response; import org.joda.time.Duration; import org.junit.Test; -import info.nightscout.androidaps.Constants; import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; import info.nightscout.androidaps.plugins.pump.omnipod.defs.DeliveryStatus; import info.nightscout.androidaps.plugins.pump.omnipod.defs.PodProgressStatus; +import info.nightscout.androidaps.plugins.pump.omnipod.util.OmnipodConst; import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; @@ -58,9 +58,9 @@ public class StatusResponseTest { StatusResponse statusResponse = new StatusResponse(bytes); assertEquals(Duration.standardMinutes(8191).getMillis(), statusResponse.getTimeActive().getMillis()); - assertEquals(Constants.POD_PULSE_SIZE * 1023, statusResponse.getInsulinNotDelivered(), 0.000001); + assertEquals(OmnipodConst.POD_PULSE_SIZE * 1023, statusResponse.getInsulinNotDelivered(), 0.000001); assertNull("Reservoir level should be null", statusResponse.getReservoirLevel()); - assertEquals(Constants.POD_PULSE_SIZE * 8191, statusResponse.getInsulin(), 0.0000001); + assertEquals(OmnipodConst.POD_PULSE_SIZE * 8191, statusResponse.getInsulin(), 0.0000001); assertEquals(15, statusResponse.getPodMessageCounter()); assertEquals(8, statusResponse.getAlerts().getAlertSlots().size()); } From aa7f921ad97a0514d39284cba5850527c108fa98 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Sun, 15 Sep 2019 15:18:55 +0200 Subject: [PATCH 03/10] more objectives --- .../constraints/objectives/objectives/Objective2.java | 8 ++++++++ app/src/main/res/values/exam.xml | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective2.java b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective2.java index 380412f7ff..3012f152ab 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective2.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective2.java @@ -183,6 +183,14 @@ public class Objective2 extends Objective { .hint(new Hint(R.string.profileswitch_hint1)) ); + tasks.add(new ExamTask(R.string.profileswitch, R.string.profileswitchtime_iwant,"profileswitchtime") + .option(new Option(R.string.profileswitchtime_1, false)) + .option(new Option(R.string.profileswitchtime__1, true)) + .option(new Option(R.string.profileswitchtime_60, false)) + .option(new Option(R.string.profileswitchtime__60, false)) + .hint(new Hint(R.string.profileswitchtime_hint1)) + ); + for (Task task : tasks) Collections.shuffle(((ExamTask)task).options); } diff --git a/app/src/main/res/values/exam.xml b/app/src/main/res/values/exam.xml index c307bc4220..e76c797412 100644 --- a/app/src/main/res/values/exam.xml +++ b/app/src/main/res/values/exam.xml @@ -143,5 +143,11 @@ Target will be 10% lower Only bottom target will be 10% lower https://androidaps.readthedocs.io/en/latest/EN/Usage/Profiles.html?highlight=profile%20switch#profile-switch + I want to do a profile switch because I had to wake up 1h earlier than usually, so it makes more sense to announce the change by the time shift with a profile switch. What number should I use? + 1 + -1 + https://androidaps.readthedocs.io/en/latest/EN/Usage/Profiles.html?highlight=profile%20switch#timeshift + 60 + -60 From 8cc6b4b0b0f28770d0ca50d32d1e931deeb591a9 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Sun, 15 Sep 2019 15:37:48 +0200 Subject: [PATCH 04/10] typo --- app/src/main/res/values/exam.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/values/exam.xml b/app/src/main/res/values/exam.xml index e76c797412..a87186aaf8 100644 --- a/app/src/main/res/values/exam.xml +++ b/app/src/main/res/values/exam.xml @@ -47,7 +47,7 @@ Help before start exercise Help after start exercise https://androidaps.readthedocs.io/en/latest/EN/Usage/temptarget.html#activity-temp-target - Do I get insuling when loop is suspended? + Do I get insulin when loop is suspended? Yes, common basal rate No, delivering of insulin is stopped Basal and ISF, IC testing From 5828e90f8351d676bd9745d6b2f182aa9485e697 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Sun, 15 Sep 2019 15:54:43 +0200 Subject: [PATCH 05/10] improved description --- app/src/main/res/values/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 3ecfa935c1..ea5b799a56 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -722,7 +722,7 @@ Values not stored! Accu-Chek Combo COMBO - Enable broadcasts to other apps (like xDrip). + Enable broadcasts to other apps (like xDrip). Do not enable if you have more than one instance of AAPS or NSClient installed! Enable local Broadcasts. ACTIVITY & FEEDBACK CARBS & BOLUS From 4546ffa8385fc52e99974aa64470e6ddf5f3dd55 Mon Sep 17 00:00:00 2001 From: Rob Kresha Date: Sun, 15 Sep 2019 11:25:52 -0500 Subject: [PATCH 06/10] Consistency, typos, and labels Small tweaks to make things more uniform. --- .../objectives/objectives/Objective2.java | 56 ++--- app/src/main/res/values/exam.xml | 197 +++++++++--------- app/src/main/res/values/strings.xml | 2 +- 3 files changed, 130 insertions(+), 125 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective2.java b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective2.java index 3012f152ab..bba29d54e7 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective2.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective2.java @@ -17,31 +17,31 @@ public class Objective2 extends Objective { @Override protected void setupTasks(List tasks) { - tasks.add(new ExamTask(R.string.dia_meaningofdia, R.string.dia_whatmeansdia,"dia") + tasks.add(new ExamTask(R.string.dia_label, R.string.dia_whatmeansdia,"dia") .option(new Option(R.string.dia_minimumis3h, false)) .option(new Option(R.string.dia_minimumis5h, true)) .option(new Option(R.string.dia_meaningisequaltodiapump, false)) .option(new Option(R.string.dia_valuemustbedetermined, true)) .hint(new Hint(R.string.dia_hint1)) ); - tasks.add(new ExamTask(R.string.hypott, R.string.hypott_whenhypott,"hypott") + tasks.add(new ExamTask(R.string.hypott_label, R.string.hypott_whenhypott,"hypott") .option(new Option(R.string.hypott_goinglow, false)) .option(new Option(R.string.hypott_havinglow, false)) .option(new Option(R.string.hypott_preventoversmb, true)) .hint(new Hint(R.string.hypott_hint1)) ); - tasks.add(new ExamTask(R.string.offlineprofile, R.string.offlineprofile_whatprofile,"offlineprofile") + tasks.add(new ExamTask(R.string.offlineprofile_label, R.string.offlineprofile_whatprofile,"offlineprofile") .option(new Option(R.string.localprofile, true)) .option(new Option(R.string.nsprofile, false)) .option(new Option(R.string.offlineprofile_nsprofile, true)) .hint(new Hint(R.string.offlineprofile_hint1)) ); - tasks.add(new ExamTask(R.string.pumpdisconnect, R.string.pumpdisconnect_whattodo,"pumpdisconnect") + tasks.add(new ExamTask(R.string.pumpdisconnect_label, R.string.pumpdisconnect_label,"pumpdisconnect") .option(new Option(R.string.pumpdisconnect_letknow, true)) .option(new Option(R.string.pumpdisconnect_dontchnage, false)) .hint(new Hint(R.string.pumpdisconnect_hint1)) ); - tasks.add(new ExamTask(R.string.objectives, R.string.objectives_howtosave,"objectives") + tasks.add(new ExamTask(R.string.objectives_label, R.string.objectives_howtosave,"objectives") .option(new Option(R.string.objectives_exportsettings, true)) .option(new Option(R.string.objectives_storeelsewhere, true)) .option(new Option(R.string.objectives_doexportonstart, false)) @@ -50,7 +50,7 @@ public class Objective2 extends Objective { .hint(new Hint(R.string.objectives_hint1)) .hint(new Hint(R.string.objectives_hint2)) ); - tasks.add(new ExamTask(R.string.noisycgm, R.string.noisycgm_whattodo,"noisycgm") + tasks.add(new ExamTask(R.string.noisycgm_label, R.string.noisycgm_whattodo,"noisycgm") .option(new Option(R.string.nothing, false)) .option(new Option(R.string.disconnectpumpfor1h, false)) .option(new Option(R.string.noisycgm_pause, true)) @@ -59,7 +59,7 @@ public class Objective2 extends Objective { .option(new Option(R.string.noisycgm_checksmoothing, true)) .hint(new Hint(R.string.noisycgm_hint1)) ); - tasks.add(new ExamTask(R.string.exercise, R.string.exercise_whattodo,"exercise") + tasks.add(new ExamTask(R.string.exercise_label, R.string.exercise_whattodo,"exercise") .option(new Option(R.string.nothing, false)) .option(new Option(R.string.exercise_setactivitytt, true)) .option(new Option(R.string.exercise_switchprofilebelow100, true)) @@ -69,17 +69,17 @@ public class Objective2 extends Objective { .option(new Option(R.string.exercise_doitafterstart, false)) .hint(new Hint(R.string.exercise_hint1)) ); - tasks.add(new ExamTask(R.string.suspendloop, R.string.suspendloop_doigetinsulin,"suspendloop") + tasks.add(new ExamTask(R.string.suspendloop_label, R.string.suspendloop_doigetinsulin,"suspendloop") .option(new Option(R.string.suspendloop_yes, true)) .option(new Option(R.string.suspendloop_no, false)) ); - tasks.add(new ExamTask(R.string.basaltest, R.string.basaltest_when,"basaltest") + tasks.add(new ExamTask(R.string.basaltest_label, R.string.basaltest_when,"basaltest") .option(new Option(R.string.basaltest_beforeloop, true)) .option(new Option(R.string.basaltest_havingregularhypo, true)) .option(new Option(R.string.basaltest_havingregularhyper, true)) .hint(new Hint(R.string.basaltest_hint1)) ); - tasks.add(new ExamTask(R.string.prerequisites, R.string.prerequisites_what, "prerequisites") + tasks.add(new ExamTask(R.string.prerequisites_label, R.string.prerequisites_what, "prerequisites") .option(new Option(R.string.prerequisites_determinedcorrectprofile, true)) .option(new Option(R.string.prerequisites_computer, true)) .option(new Option(R.string.prerequisites_phone, true)) @@ -94,7 +94,7 @@ public class Objective2 extends Objective { .option(new Option(R.string.prerequisites_supportedcgm, true)) .hint(new Hint(R.string.prerequisites_hint1)) ); - tasks.add(new ExamTask(R.string.update_update, R.string.whatistrue,"update") + tasks.add(new ExamTask(R.string.update_label, R.string.whatistrue,"update") .option(new Option(R.string.update_git, true)) .option(new Option(R.string.update_asap, true)) .option(new Option(R.string.update_keys, true)) @@ -102,7 +102,7 @@ public class Objective2 extends Objective { .option(new Option(R.string.update_askfriend, false)) .hint(new Hint(R.string.update_hint1)) ); - tasks.add(new ExamTask(R.string.troubleshooting, R.string.troubleshooting_wheretoask,"troubleshooting") + tasks.add(new ExamTask(R.string.troubleshooting_label, R.string.troubleshooting_wheretoask,"troubleshooting") .option(new Option(R.string.troubleshooting_fb, true)) .option(new Option(R.string.troubleshooting_wiki, true)) .option(new Option(R.string.troubleshooting_gitter, true)) @@ -112,47 +112,47 @@ public class Objective2 extends Objective { .hint(new Hint(R.string.troubleshooting_hint2)) .hint(new Hint(R.string.troubleshooting_hint3)) ); - tasks.add(new ExamTask(R.string.insulin, R.string.insulin_ultrarapid,"insulin") + tasks.add(new ExamTask(R.string.insulin_label, R.string.insulin_ultrarapid,"insulin") .option(new Option(R.string.insulin_fiasp, true)) .option(new Option(R.string.insulin_novorapid, false)) .option(new Option(R.string.insulin_humalog, false)) .option(new Option(R.string.insulin_actrapid, false)) .hint(new Hint(R.string.insulin_hint1)) ); - tasks.add(new ExamTask(R.string.sensitivity, R.string.sensitivity_which,"sensitivity") + tasks.add(new ExamTask(R.string.sensitivity_label, R.string.sensitivity_which,"sensitivity") .option(new Option(R.string.sensitivityweightedaverage, true)) .option(new Option(R.string.sensitivityoref0, false)) .option(new Option(R.string.sensitivityoref1, false)) .option(new Option(R.string.sensitivityaaps, true)) .hint(new Hint(R.string.sensitivity_hint1)) ); - tasks.add(new ExamTask(R.string.sensitivity, R.string.sensitivityuam_which,"sensitivityuam") + tasks.add(new ExamTask(R.string.sensitivity_label, R.string.sensitivityuam_which,"sensitivityuam") .option(new Option(R.string.sensitivityweightedaverage, false)) .option(new Option(R.string.sensitivityoref0, false)) .option(new Option(R.string.sensitivityoref1, true)) .option(new Option(R.string.sensitivityaaps, false)) .hint(new Hint(R.string.sensitivity_hint1)) ); - tasks.add(new ExamTask(R.string.wrongcarbs, R.string.wrongcarbs_whattodo,"wrongcarbs") + tasks.add(new ExamTask(R.string.wrongcarbs_label, R.string.wrongcarbs_whattodo,"wrongcarbs") .option(new Option(R.string.wrongcarbs_addfakeinsulin, false)) .option(new Option(R.string.wrongcarbs_treatmentstab, true)) ); - tasks.add(new ExamTask(R.string.extendedcarbs, R.string.extendedcarbs_handling,"extendedcarbs") + tasks.add(new ExamTask(R.string.extendedcarbs_label, R.string.extendedcarbs_handling,"extendedcarbs") .option(new Option(R.string.extendedcarbs_useextendedcarbs, true)) .option(new Option(R.string.extendedcarbs_add, false)) .option(new Option(R.string.extendedcarbs_useextendedbolus, false)) .hint(new Hint(R.string.extendedcarbs_hint1)) ); - tasks.add(new ExamTask(R.string.nsclient_monitoring, R.string.nsclient_howcanyou,"nsclient") - .option(new Option(R.string.nightscout, true)) + tasks.add(new ExamTask(R.string.nsclient_label, R.string.nsclient_howcanyou,"nsclient") + .option(new Option(R.string.nsclient_nightscout, true)) .option(new Option(R.string.nsclientinternal, true)) - .option(new Option(R.string.dexcomfollow, true)) - .option(new Option(R.string.dexcomfollowxdrip, false)) - .option(new Option(R.string.xdripfollower, true)) - .option(new Option(R.string.looponiphone, false)) - .option(new Option(R.string.spikeiphone, true)) + .option(new Option(R.string.nsclient_dexcomfollow, true)) + .option(new Option(R.string.nsclient_dexcomfollowxdrip, false)) + .option(new Option(R.string.nsclient_xdripfollower, true)) + .option(new Option(R.string.nsclient_looponiphone, false)) + .option(new Option(R.string.nsclient_spikeiphone, true)) ); - tasks.add(new ExamTask(R.string.nsprofileview_isf_label, R.string.whatistrue,"isf") + tasks.add(new ExamTask(R.string.isf_label_isf_label, R.string.whatistrue,"isf") .option(new Option(R.string.isf_increasingvalue, true)) .option(new Option(R.string.isf_decreasingvalue, false)) .option(new Option(R.string.isf_noeffect, false)) @@ -161,7 +161,7 @@ public class Objective2 extends Objective { .hint(new Hint(R.string.isf_hint1)) .hint(new Hint(R.string.isf_hint2)) ); - tasks.add(new ExamTask(R.string.nsprofileview_ic_label, R.string.whatistrue,"ic") + tasks.add(new ExamTask(R.string.ic_label, R.string.whatistrue,"ic") .option(new Option(R.string.ic_increasingvalue, true)) .option(new Option(R.string.ic_decreasingvalue, false)) .option(new Option(R.string.ic_noeffect, false)) @@ -169,7 +169,7 @@ public class Objective2 extends Objective { .option(new Option(R.string.ic_meaning, false)) .hint(new Hint(R.string.ic_hint1)) ); - tasks.add(new ExamTask(R.string.profileswitch, R.string.profileswitch_pctwillchange,"profileswitch") + tasks.add(new ExamTask(R.string.profileswitch_label, R.string.profileswitch_pctwillchange,"profileswitch") .option(new Option(R.string.profileswitch_basalhigher, false)) .option(new Option(R.string.profileswitch_basallower, true)) .option(new Option(R.string.profileswitch_ichigher, true)) @@ -183,7 +183,7 @@ public class Objective2 extends Objective { .hint(new Hint(R.string.profileswitch_hint1)) ); - tasks.add(new ExamTask(R.string.profileswitch, R.string.profileswitchtime_iwant,"profileswitchtime") + tasks.add(new ExamTask(R.string.profileswitch_label, R.string.profileswitchtime_iwant,"profileswitchtime") .option(new Option(R.string.profileswitchtime_1, false)) .option(new Option(R.string.profileswitchtime__1, true)) .option(new Option(R.string.profileswitchtime_60, false)) diff --git a/app/src/main/res/values/exam.xml b/app/src/main/res/values/exam.xml index a87186aaf8..546262a71f 100644 --- a/app/src/main/res/values/exam.xml +++ b/app/src/main/res/values/exam.xml @@ -1,147 +1,152 @@ What is true about DIA? - Meaning of DIA + Topic: Duration of Insulin Action The predetermined minimum is 3 hours. The predetermined minimum is 5 hours. https://androidaps.readthedocs.io/en/latest/EN/Configuration/Config-Builder.html?#insulin It is equal to the DIA parameter used in your pump. You have to determine your individual value (but not less than 5 hours). - Hypo temp target + Topic: Hypo Temp-Target Why is it useful to set a hypo TT? - Prevent to be low. + Prevent BG from going low. To help recovering from a low BG. - To prevent SMB after a hypo rise from fast carbs + To prevent SMB enactment after a hypo rise from fast carbs. https://androidaps.readthedocs.io/en/latest/EN/Usage/temptarget.html Which profile can be used and configured offline? - Offline profile - NS Profile can be used but not configured + Topic: Offline Profile + NS Profile can be used, but not configured. https://androidaps.readthedocs.io/en/latest/EN/Configuration/Config-Builder.html#profile - Taking off pump + Topic: Disconnecting from the Pump What to do when taking the pump off? - Let loop know that there is no insulin running to your body by clicking disconnect pump. - Don\'t change anything in loop, just take it off. + Let the loop know that there is no insulin being delivered to your body by clicking disconnect pump. + Don\'t change anything in loop, just take the pump off. https://androidaps.readthedocs.io/en/latest/EN/Getting-Started/FAQ.html#other-settings + Topic: AndroidAPS Settings What are best practices to backup your settings? Locally export them from Maintenance menu. - Store exported file to another place like email, Dropbox, Google drive … + Store exported file to another place like email, Dropbox, Google drive… Export them right after installation of AAPS. Export them after every change of a setting. Export them when you finish initial settings. https://androidaps.readthedocs.io/en/latest/EN/Usage/ExportImportSettings.html https://androidaps.readthedocs.io/en/latest/EN/Getting-Started/FAQ.html#what-emergency-equipment-is-recommended-to-take-with-me - Noisy CGM + Topic: Noisy CGM Readings What to do when you see CGM signals are too noisy? Nothing, the loop will deal with it. - Pause closed loop mode to avoid overdosing. - Replace sensor + Pause closed-loop mode to avoid overdosing. + Replace the CGM sensor. Turn off the phone. https://androidaps.readthedocs.io/en/latest/EN/Usage/Smoothing-Blood-Glucose-Data-in-xDrip.html#smoothing-blood-glucose-data Check if your CGM app smoothes data. - Exercise - How is the best practice to help the system deal with exercise - Set activity temp target - Do a profile switch below 100% - Do profile switch above 100% - Stop loop - Help before start exercise - Help after start exercise + Topic: Exercise + How can you help the system deal with exercise? + Set an activity temp-target. + Do a profile switch below 100%. + Do a profile switch above 100%. + Stop the loop. + Set activity temp-target before the start of exercise. + Set activity temp-target after the start of exercise. https://androidaps.readthedocs.io/en/latest/EN/Usage/temptarget.html#activity-temp-target + Topic: Suspended Loop Do I get insulin when loop is suspended? - Yes, common basal rate - No, delivering of insulin is stopped - Basal and ISF, IC testing - When should I test basals, ISF and IC? - Before I start looping - When having regular hypos - When having regular hypers + Yes, the common basal rate. + No, delivery of insulin is stopped. + Topic: Basal, ISF, and IC Testing + When should I validate basals, ISF, and IC values? + Before I start looping. + When having regular hypos BG\'s. + When having regular hypers BG\'s. https://androidaps.readthedocs.io/en/latest/EN/Getting-Started/FAQ.html#androidaps-settings - Prerequisites + Topic: Prerequisites What do I need? - Determined correct profile (Basals, IC, ISF, DIA) - Computer to create an APK - Supported phone - Car - Nightscout to pass objectives - Tidepool account - Google account - Github account - To be an Android developer - Own a 670g pump + Determined correct profile (Basals, IC, ISF, DIA). + A computer to create an APK. + A supported phone. + A Car. + Nightscout to pass the objectives. + A Tidepool account. + A Google account. + A Github account. + Need to be an Android developer. + A MiniMed 670G pump. https://androidaps.readthedocs.io/en/latest/EN/Module/module.html - Smartwatch - Supported CGM - Updating of AndroidAPS + A Smartwatch. + A Supported CGM. + Topic: Updating of AndroidAPS What is true? - You need to have Git installed - Update as soon as new version is released - Use the same signing keys - Never update if system is working well - Ask your friend for new APK + You need to have Git installed. + Update as soon as new version is released. + You can use the same signing keys. + Never update if the system is working well. + Ask your friend for the new APK. https://androidaps.readthedocs.io/en/latest/EN/Installing-AndroidAPS/Update-to-new-version.html#update-to-a-new-version-or-branch - Troubleshooting + Topic: Troubleshooting Where to look for help? - Facebook group - Wiki - Gitter - Google support - Your endo + Join the AndroidAPS Facebook group. + Visit the AndroidAPS Wiki. + Visit AndroidAPS Gitter Room. + Visit AndroidAPS Google support + Speak to your endocrinologist. https://androidaps.readthedocs.io/en/latest/EN/Installing-AndroidAPS/Update-to-new-version.html#troubleshooting https://www.facebook.com/groups/AndroidAPSUsers/ https://gitter.im/MilosKozak/AndroidAPS - Insulin - Which insulin can be used with Ultra-Rapid-Oref plugin? - Fiasp - Novorapid - Humalog - Actrapid + Topic: Insulin + Which brand of insulin can be used with Ultra-Rapid-Oref plugin? + Fiasp® + NovoRapid® + Humalog® + Actrapid® https://androidaps.readthedocs.io/en/latest/EN/Configuration/Config-Builder.html#insulin - Sensitivity plugin + Topic: Sensitivity Plugin Which sensitivity plugin has user defined time range for detection? https://androidaps.readthedocs.io/en/latest/EN/Configuration/Sensitivity-detection-and-COB.html - Which sensitivity plugin must be used for UAM? - Wrong carbs + Which sensitivity plugin must be used for the UAM feature? + Topic: Wrong Carb Entries You see you have entered wrong carbs. What should you do? - Go to treatments, delete wrong carbs and enter new carbs + Go to Treatments, delete wrong carbs and enter new carbs. Add fake insulin by using Refill function - Food with fat and protein - What to do if your food contains larger amount of fat or proteins? - Recalculate fat and proteins to carbs and use \"Extended carbs\" feature to tell system about it - Recalculate fat and proteins to carbs and add it to bolus calculation - Use extended bolus to cover fat and proteins + Topic: Food with Fat and Protein + What to do if your food contains a large amount of fat and\/or proteins? + Recalculate fat and proteins to carbs and use \"Extended carbs\" feature. + Recalculate fat and proteins to carbs and add it to bolus calculation. + Use extended bolus to cover fat and proteins. https://androidaps.readthedocs.io/en/latest/EN/Usage/Extended-Carbs.html - Monitoring children + Topic: Monitoring Children How can you monitor AAPS of your child remotely? - Nightscout - Dexcom follow if you are using original Dexcom app - Dexcom follow if you are using xDrip - xDrip in follower mode - Loop app on iPhone - Spike on iPhone - Assume you have high glycemia. Increasing ISF number will lead to giving less insulin if you try to correct high glycemia by bolus wizard - Assume you have high glycemia. Decreasing ISF number will lead to giving less insulin if you try to correct high glycemia by bolus wizard - Changing ISF has no effect on amount of insulin given by APS when trying to correct high glycemia - You have to enter ISF in preferences - Changing ISF in profile is enough to apply the change + Using a Nightscout site. + Dexcom Follow app if you are using the original Dexcom app. + Dexcom Follow if you are using the xDrip app. + xDrip running in follower mode. + Loop app on iPhone. + Spike app on iPhone. + Topic: Insulin Sensitivity Factor + Increasing ISF number will lead to less insulin delivery if you are trying to lower your BG with the bolus wizard. + Decreasing ISF number will lead to less insulin delivery if you are trying to lower your BG with the bolus wizard. + Changing ISF has no effect on amount of insulin given by AAPS when trying to correct hyperglycemia. + You have to enter ISF in Preferences. + Changing the ISF value in your profile is enough to apply the change. https://androidaps.readthedocs.io/en/latest/EN/Getting-Started/FAQ.html#insulin-sensitivity-factor-isf-mmol-l-u-or-mg-dl-u https://androidaps.readthedocs.io/en/latest/EN/Usage/Profiles.html - Increasing IC value will lead to giving less insulin for the same amount of carbs - Decreasing IC value will lead to giving less insulin for the same amount of carbs - Assume you have no active carbs. Changing IC will lead to different amount of insuling to correct your glycemia - IC will be different if you count bread unit as 10g or 12g - IC meaning is: How much bread units is covered by 1U of insulin + Topic: The IC Value + Increasing the IC value will lead to less insulin delivery for the same amount of carbs. + Decreasing the IC value will lead to less insulin delivery for the same amount of carbs. + Assume you have 0 COB. Changing IC will lead to a different amount of insulin to correct your BG number. + IC will be different if you count bread unit as 10g or 12g. + IC meaning is: How many bread units are covered by 1U of insulin. https://androidaps.readthedocs.io/en/latest/EN/Getting-Started/FAQ.html#carbohydrate-to-insulin-ratio-cr-g-u - By specifying 90% in profile switch - Basals will be 10% higher - Basals will be 10% lower - IC value will be 10% higher - IC value will be 10% lower - ISF value will be 10% higher - ISF value will be 10% lower - You will get around 10% less insulin in total - Target wiil be 10% higher - Target will be 10% lower - Only bottom target will be 10% lower + Topic: Profile Switching + When specifying 90% in profile switch… + Basals will be 10% higher. + Basals will be 10% lower. + IC value will be 10% higher. + IC value will be 10% lower. + ISF value will be 10% higher. + ISF value will be 10% lower. + You will get 10% less insulin in total. + Target wiil be 10% higher. + Target will be 10% lower. + Only bottom target will be 10% lower. https://androidaps.readthedocs.io/en/latest/EN/Usage/Profiles.html?highlight=profile%20switch#profile-switch I want to do a profile switch because I had to wake up 1h earlier than usually, so it makes more sense to announce the change by the time shift with a profile switch. What number should I use? 1 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index ea5b799a56..cfc2457903 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1516,7 +1516,7 @@ Not Started RileyLink Initialization… RileyLink Error - Tunning up RileyLink and Pump + Tuning up RileyLink and Pump Problem connecting to Pump Connected From 37589c8f9014e69a97345c6a892398ba7fdf6ab8 Mon Sep 17 00:00:00 2001 From: Rob Kresha Date: Sun, 15 Sep 2019 11:29:37 -0500 Subject: [PATCH 07/10] Update Objective2.java typo --- .../plugins/constraints/objectives/objectives/Objective2.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective2.java b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective2.java index bba29d54e7..a3064bbb0a 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective2.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective2.java @@ -152,7 +152,7 @@ public class Objective2 extends Objective { .option(new Option(R.string.nsclient_looponiphone, false)) .option(new Option(R.string.nsclient_spikeiphone, true)) ); - tasks.add(new ExamTask(R.string.isf_label_isf_label, R.string.whatistrue,"isf") + tasks.add(new ExamTask(R.string.isf_label, R.string.whatistrue,"isf") .option(new Option(R.string.isf_increasingvalue, true)) .option(new Option(R.string.isf_decreasingvalue, false)) .option(new Option(R.string.isf_noeffect, false)) From 21dcd3a0ab6286c979163323bd75762e40021ffa Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Sun, 15 Sep 2019 18:36:59 +0200 Subject: [PATCH 08/10] google-services:4.3.2 --- build.gradle | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index 6513ece66e..8b9295e9e8 100644 --- a/build.gradle +++ b/build.gradle @@ -1,17 +1,15 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.kotlin_version = '1.3.41' - ext.butterknifeVersion = '10.1.0' + ext.kotlin_version = '1.3.50' repositories { google() jcenter() - //maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } maven { url 'https://maven.fabric.io/public' } } dependencies { classpath 'com.android.tools.build:gradle:3.5.0' - classpath 'com.google.gms:google-services:4.3.0' + classpath 'com.google.gms:google-services:4.3.2' classpath 'io.fabric.tools:gradle:1.31.0' // NOTE: Do not place your application dependencies here; they belong From 9295d51e1c4c80045edc23efb55a30c2bf0dd5eb Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Sun, 15 Sep 2019 18:56:54 +0200 Subject: [PATCH 09/10] androidx.appcompat:appcompat:1.1.0 --- app/build.gradle | 2 +- .../objectives/activities/ObjectivesExamDialog.kt | 4 ++-- .../general/automation/dialogs/ChooseActionDialog.kt | 2 +- .../general/automation/dialogs/ChooseTriggerDialog.kt | 2 +- .../general/automation/dialogs/EditActionDialog.kt | 2 +- .../plugins/general/automation/dialogs/EditEventDialog.kt | 2 +- .../general/automation/dialogs/EditTriggerDialog.kt | 2 +- .../plugins/general/overview/dialogs/ErrorDialog.kt | 2 +- .../plugins/general/overview/dialogs/WizardDialog.kt | 8 ++++---- .../plugins/treatments/dialogs/WizardInfoDialog.kt | 2 +- .../plugins/treatments/fragments/ProfileViewerDialog.kt | 2 +- 11 files changed, 15 insertions(+), 15 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index fdc2d5ebc9..f3b0dde3b7 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -230,7 +230,7 @@ dependencies { transitive = true; } - implementation 'androidx.appcompat:appcompat:1.0.2' + implementation 'androidx.appcompat:appcompat:1.1.0' implementation 'androidx.legacy:legacy-support-v13:1.0.0' implementation 'androidx.legacy:legacy-support-v4:1.0.0' implementation 'androidx.cardview:cardview:1.0.0' diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/activities/ObjectivesExamDialog.kt b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/activities/ObjectivesExamDialog.kt index a0d6f6cedf..1c7c6c7ee1 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/activities/ObjectivesExamDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/activities/ObjectivesExamDialog.kt @@ -36,8 +36,8 @@ class ObjectivesExamDialog : DialogFragment() { override fun onStart() { super.onStart() - dialog.setCanceledOnTouchOutside(false) - dialog.window?.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); + dialog?.setCanceledOnTouchOutside(false) + dialog?.window?.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); } override fun onResume() { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/automation/dialogs/ChooseActionDialog.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/automation/dialogs/ChooseActionDialog.kt index 079858ce43..094cae54c9 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/automation/dialogs/ChooseActionDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/automation/dialogs/ChooseActionDialog.kt @@ -26,7 +26,7 @@ class ChooseActionDialog : DialogFragment() { checkedIndex = bundle.getInt("checkedIndex") } - dialog.setCanceledOnTouchOutside(false) + dialog?.setCanceledOnTouchOutside(false) return inflater.inflate(R.layout.automation_dialog_choose_action, container, false) } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/automation/dialogs/ChooseTriggerDialog.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/automation/dialogs/ChooseTriggerDialog.kt index b77c0f4a40..6ccc1ebb6f 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/automation/dialogs/ChooseTriggerDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/automation/dialogs/ChooseTriggerDialog.kt @@ -29,7 +29,7 @@ class ChooseTriggerDialog : DialogFragment() { checkedIndex = bundle.getInt("checkedIndex") } - dialog.setCanceledOnTouchOutside(false) + dialog?.setCanceledOnTouchOutside(false) return inflater.inflate(R.layout.automation_dialog_choose_trigger, container, false) } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/automation/dialogs/EditActionDialog.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/automation/dialogs/EditActionDialog.kt index 48669c9ed8..dd082eabae 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/automation/dialogs/EditActionDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/automation/dialogs/EditActionDialog.kt @@ -26,7 +26,7 @@ class EditActionDialog : DialogFragment() { bundle.getString("action")?.let { action = Action.instantiate(JSONObject(it)) } } - dialog.setCanceledOnTouchOutside(false) + dialog?.setCanceledOnTouchOutside(false) return inflater.inflate(R.layout.automation_dialog_action, container, false) } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/automation/dialogs/EditEventDialog.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/automation/dialogs/EditEventDialog.kt index 1f5725335e..a55f29d639 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/automation/dialogs/EditEventDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/automation/dialogs/EditEventDialog.kt @@ -35,7 +35,7 @@ class EditEventDialog : DialogFragment() { bundle.getString("event")?.let { event = AutomationEvent().fromJSON(it) } } - dialog.setCanceledOnTouchOutside(false) + dialog?.setCanceledOnTouchOutside(false) return inflater.inflate(R.layout.automation_dialog_event, container, false) } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/automation/dialogs/EditTriggerDialog.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/automation/dialogs/EditTriggerDialog.kt index e0aa80e24b..4013acd5c5 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/automation/dialogs/EditTriggerDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/automation/dialogs/EditTriggerDialog.kt @@ -23,7 +23,7 @@ class EditTriggerDialog : DialogFragment() { bundle.getString("trigger")?.let { trigger = Trigger.instantiate(it) } } - dialog.setCanceledOnTouchOutside(false) + dialog?.setCanceledOnTouchOutside(false) return inflater.inflate(R.layout.automation_dialog_edit_trigger, container, false) } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/dialogs/ErrorDialog.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/dialogs/ErrorDialog.kt index d9d7c74542..8ea499d4ef 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/dialogs/ErrorDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/dialogs/ErrorDialog.kt @@ -24,7 +24,7 @@ class ErrorDialog : DialogFragment() { override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { - dialog.setTitle(title) + dialog?.setTitle(title) isCancelable = false savedInstanceState?.let { bundle -> diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/dialogs/WizardDialog.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/dialogs/WizardDialog.kt index 3d64345650..1b52e5f3ff 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/dialogs/WizardDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/dialogs/WizardDialog.kt @@ -53,7 +53,7 @@ class WizardDialog : DialogFragment() { private var disposable: CompositeDisposable = CompositeDisposable() - override fun onAttach(context: Context?) { + override fun onAttach(context: Context) { super.onAttach(context) this.parentContext = context } @@ -78,10 +78,10 @@ class WizardDialog : DialogFragment() { override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { - dialog.window?.requestFeature(Window.FEATURE_NO_TITLE) - dialog.window?.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN) + dialog?.window?.requestFeature(Window.FEATURE_NO_TITLE) + dialog?.window?.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN) isCancelable = true - dialog.setCanceledOnTouchOutside(false) + dialog?.setCanceledOnTouchOutside(false) return inflater.inflate(R.layout.overview_wizard_dialog, container, false) } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/treatments/dialogs/WizardInfoDialog.kt b/app/src/main/java/info/nightscout/androidaps/plugins/treatments/dialogs/WizardInfoDialog.kt index 4e77a8f758..c65c75c00e 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/treatments/dialogs/WizardInfoDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/treatments/dialogs/WizardInfoDialog.kt @@ -21,7 +21,7 @@ class WizardInfoDialog : DialogFragment() { override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { - dialog.window?.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN) + dialog?.window?.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN) isCancelable = true return inflater.inflate(R.layout.treatments_wizardinfo_dialog, container, false) } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/treatments/fragments/ProfileViewerDialog.kt b/app/src/main/java/info/nightscout/androidaps/plugins/treatments/fragments/ProfileViewerDialog.kt index 0d09f60755..a27ebfb656 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/treatments/fragments/ProfileViewerDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/treatments/fragments/ProfileViewerDialog.kt @@ -84,7 +84,7 @@ class ProfileViewerDialog : DialogFragment() { } override fun onResume() { - dialog.window?.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT) + dialog?.window?.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT) super.onResume() } From afa654f3b949c3a565ef7ecd57abeb7935c798da Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Sun, 15 Sep 2019 19:04:34 +0200 Subject: [PATCH 10/10] com.google.firebase:firebase-core:17.2.0 --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index f3b0dde3b7..b43a768ed4 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -225,7 +225,7 @@ dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') implementation 'com.google.android.gms:play-services-wearable:17.0.0' - implementation 'com.google.firebase:firebase-core:17.1.0' + implementation 'com.google.firebase:firebase-core:17.2.0' implementation("com.crashlytics.sdk.android:crashlytics:2.9.9@aar") { transitive = true; }