Merge branch 'omnipod_eros_dev' into omnipod_eros_dev_remove_omnipod_pump_state
This commit is contained in:
commit
c84798e368
|
@ -66,6 +66,7 @@ import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.Riley
|
||||||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.tasks.ResetRileyLinkConfigurationTask;
|
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.tasks.ResetRileyLinkConfigurationTask;
|
||||||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.tasks.ServiceTaskExecutor;
|
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.tasks.ServiceTaskExecutor;
|
||||||
import info.nightscout.androidaps.plugins.pump.common.utils.DateTimeUtil;
|
import info.nightscout.androidaps.plugins.pump.common.utils.DateTimeUtil;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.data.ActiveBolus;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.data.RLHistoryItemOmnipod;
|
import info.nightscout.androidaps.plugins.pump.omnipod.data.RLHistoryItemOmnipod;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.definition.OmnipodCommandType;
|
import info.nightscout.androidaps.plugins.pump.omnipod.definition.OmnipodCommandType;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.definition.OmnipodCustomActionType;
|
import info.nightscout.androidaps.plugins.pump.omnipod.definition.OmnipodCustomActionType;
|
||||||
|
@ -254,16 +255,16 @@ public class OmnipodPumpPlugin extends PumpPluginBase implements PumpInterface,
|
||||||
// If so, add it to history
|
// If so, add it to history
|
||||||
// Needs to be done after EventAppInitialized because otherwise, TreatmentsPlugin.onStart() hasn't been called yet
|
// Needs to be done after EventAppInitialized because otherwise, TreatmentsPlugin.onStart() hasn't been called yet
|
||||||
// so it didn't initialize a TreatmentService yet, resulting in a NullPointerException
|
// so it didn't initialize a TreatmentService yet, resulting in a NullPointerException
|
||||||
if (sp.contains(OmnipodStorageKeys.Prefs.CurrentBolus)) {
|
if (sp.contains(OmnipodStorageKeys.Prefs.ActiveBolus)) {
|
||||||
String currentBolusString = sp.getString(OmnipodStorageKeys.Prefs.CurrentBolus, "");
|
String activeBolusString = sp.getString(OmnipodStorageKeys.Prefs.ActiveBolus, "");
|
||||||
aapsLogger.warn(LTag.PUMP, "Found active bolus in SP. Adding Treatment: {}", currentBolusString);
|
aapsLogger.warn(LTag.PUMP, "Found active bolus in SP: {}. Adding Treatment.", activeBolusString);
|
||||||
try {
|
try {
|
||||||
DetailedBolusInfo detailedBolusInfo = aapsOmnipodUtil.getGsonInstance().fromJson(currentBolusString, DetailedBolusInfo.class);
|
ActiveBolus activeBolus = aapsOmnipodUtil.getGsonInstance().fromJson(activeBolusString, ActiveBolus.class);
|
||||||
aapsOmnipodManager.addBolusToHistory(detailedBolusInfo);
|
aapsOmnipodManager.addBolusToHistory(activeBolus.toDetailedBolusInfo(aapsLogger));
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
aapsLogger.error(LTag.PUMP, "Failed to add active bolus to history", ex);
|
aapsLogger.error(LTag.PUMP, "Failed to add active bolus to history", ex);
|
||||||
}
|
}
|
||||||
sp.remove(OmnipodStorageKeys.Prefs.CurrentBolus);
|
sp.remove(OmnipodStorageKeys.Prefs.ActiveBolus);
|
||||||
}
|
}
|
||||||
}, fabricPrivacy::logException)
|
}, fabricPrivacy::logException)
|
||||||
);
|
);
|
||||||
|
|
|
@ -0,0 +1,79 @@
|
||||||
|
package info.nightscout.androidaps.plugins.pump.omnipod.data;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.json.JSONException;
|
||||||
|
import org.json.JSONObject;
|
||||||
|
|
||||||
|
import info.nightscout.androidaps.data.DetailedBolusInfo;
|
||||||
|
import info.nightscout.androidaps.logging.AAPSLogger;
|
||||||
|
import info.nightscout.androidaps.logging.LTag;
|
||||||
|
|
||||||
|
// Used for storing active bolus during bolus,
|
||||||
|
// so we can recover it and add it to treatments after the app crashed or got killed
|
||||||
|
// Storing DetailedBolusInfo itself is no good because it contains a reference to Context
|
||||||
|
// and to JSONObject, which are both not serializable
|
||||||
|
// TODO add tests
|
||||||
|
public class ActiveBolus {
|
||||||
|
private long date;
|
||||||
|
private long lastKnownBolusTime;
|
||||||
|
private String eventType;
|
||||||
|
private double insulin;
|
||||||
|
private double carbs;
|
||||||
|
private int source;
|
||||||
|
private boolean isValid;
|
||||||
|
private double glucose;
|
||||||
|
private String glucoseType;
|
||||||
|
private int carbTime;
|
||||||
|
private String boluscalc;
|
||||||
|
private long pumpId;
|
||||||
|
private boolean isSMB;
|
||||||
|
private long deliverAt;
|
||||||
|
private String notes;
|
||||||
|
|
||||||
|
public static ActiveBolus fromDetailedBolusInfo(DetailedBolusInfo detailedBolusInfo) {
|
||||||
|
ActiveBolus activeBolus = new ActiveBolus();
|
||||||
|
activeBolus.date = detailedBolusInfo.date;
|
||||||
|
activeBolus.lastKnownBolusTime = detailedBolusInfo.lastKnownBolusTime;
|
||||||
|
activeBolus.eventType = detailedBolusInfo.eventType;
|
||||||
|
activeBolus.insulin = detailedBolusInfo.insulin;
|
||||||
|
activeBolus.carbs = detailedBolusInfo.carbs;
|
||||||
|
activeBolus.source = detailedBolusInfo.source;
|
||||||
|
activeBolus.isValid = detailedBolusInfo.isValid;
|
||||||
|
activeBolus.glucose = detailedBolusInfo.glucose;
|
||||||
|
activeBolus.glucoseType = detailedBolusInfo.glucoseType;
|
||||||
|
activeBolus.carbTime = detailedBolusInfo.carbTime;
|
||||||
|
activeBolus.boluscalc = detailedBolusInfo.boluscalc == null ? null : detailedBolusInfo.boluscalc.toString();
|
||||||
|
activeBolus.pumpId = detailedBolusInfo.pumpId;
|
||||||
|
activeBolus.isSMB = detailedBolusInfo.isSMB;
|
||||||
|
activeBolus.deliverAt = detailedBolusInfo.deliverAt;
|
||||||
|
activeBolus.notes = detailedBolusInfo.notes;
|
||||||
|
return activeBolus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DetailedBolusInfo toDetailedBolusInfo(AAPSLogger aapsLogger) {
|
||||||
|
DetailedBolusInfo detailedBolusInfo = new DetailedBolusInfo();
|
||||||
|
detailedBolusInfo.date = date;
|
||||||
|
detailedBolusInfo.lastKnownBolusTime = lastKnownBolusTime;
|
||||||
|
detailedBolusInfo.eventType = eventType;
|
||||||
|
detailedBolusInfo.insulin = insulin;
|
||||||
|
detailedBolusInfo.carbs = carbs;
|
||||||
|
detailedBolusInfo.source = source;
|
||||||
|
detailedBolusInfo.isValid = isValid;
|
||||||
|
detailedBolusInfo.glucose = glucose;
|
||||||
|
detailedBolusInfo.glucoseType = glucoseType;
|
||||||
|
detailedBolusInfo.carbTime = carbTime;
|
||||||
|
if (!StringUtils.isEmpty(boluscalc)) {
|
||||||
|
try {
|
||||||
|
detailedBolusInfo.boluscalc = new JSONObject(boluscalc);
|
||||||
|
} catch (JSONException ex) {
|
||||||
|
// ignore
|
||||||
|
aapsLogger.warn(LTag.PUMP, "Could not parse bolusCalc string to JSON: " + boluscalc, ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
detailedBolusInfo.pumpId = pumpId;
|
||||||
|
detailedBolusInfo.isSMB = isSMB;
|
||||||
|
detailedBolusInfo.deliverAt = deliverAt;
|
||||||
|
detailedBolusInfo.notes = notes;
|
||||||
|
return detailedBolusInfo;
|
||||||
|
}
|
||||||
|
}
|
|
@ -7,7 +7,7 @@ public class OmnipodStorageKeys {
|
||||||
|
|
||||||
public static class Prefs {
|
public static class Prefs {
|
||||||
public static final String PodState = Prefix + "pod_state";
|
public static final String PodState = Prefix + "pod_state";
|
||||||
public static final String CurrentBolus = Prefix + "current_bolus";
|
public static final String ActiveBolus = Prefix + "current_bolus";
|
||||||
public static final int BeepBasalEnabled = R.string.key_omnipod_beep_basal_enabled;
|
public static final int BeepBasalEnabled = R.string.key_omnipod_beep_basal_enabled;
|
||||||
public static final int BeepBolusEnabled = R.string.key_omnipod_beep_bolus_enabled;
|
public static final int BeepBolusEnabled = R.string.key_omnipod_beep_bolus_enabled;
|
||||||
public static final int BeepSMBEnabled = R.string.key_omnipod_beep_smb_enabled;
|
public static final int BeepSMBEnabled = R.string.key_omnipod_beep_smb_enabled;
|
||||||
|
|
|
@ -2,13 +2,13 @@ package info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.act
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.rileylink.OmnipodRileyLinkCommunicationManager;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.ActionInitializationException;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.command.AcknowledgeAlertsCommand;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.command.AcknowledgeAlertsCommand;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.response.StatusResponse;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.response.StatusResponse;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.AlertSet;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.AlertSet;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.AlertSlot;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.AlertSlot;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.ActionInitializationException;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.manager.PodStateManager;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.manager.PodStateManager;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.rileylink.OmnipodRileyLinkCommunicationManager;
|
||||||
|
|
||||||
public class AcknowledgeAlertsAction implements OmnipodAction<StatusResponse> {
|
public class AcknowledgeAlertsAction implements OmnipodAction<StatusResponse> {
|
||||||
private final PodStateManager podStateManager;
|
private final PodStateManager podStateManager;
|
||||||
|
|
|
@ -5,16 +5,16 @@ import org.joda.time.DateTimeZone;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.rileylink.OmnipodRileyLinkCommunicationManager;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.IllegalMessageAddressException;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.IllegalPodProgressException;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.IllegalVersionResponseTypeException;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.OmnipodMessage;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.OmnipodMessage;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.command.AssignAddressCommand;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.command.AssignAddressCommand;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.response.VersionResponse;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.response.VersionResponse;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.PodProgressStatus;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.manager.PodStateManager;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.OmnipodConstants;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.OmnipodConstants;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.PodProgressStatus;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.IllegalMessageAddressException;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.IllegalPodProgressException;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.IllegalVersionResponseTypeException;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.manager.PodStateManager;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.rileylink.OmnipodRileyLinkCommunicationManager;
|
||||||
|
|
||||||
public class AssignAddressAction implements OmnipodAction<VersionResponse> {
|
public class AssignAddressAction implements OmnipodAction<VersionResponse> {
|
||||||
private final PodStateManager podStateManager;
|
private final PodStateManager podStateManager;
|
||||||
|
|
|
@ -4,14 +4,14 @@ import org.joda.time.Duration;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.rileylink.OmnipodRileyLinkCommunicationManager;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.ActionInitializationException;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.OmnipodMessage;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.OmnipodMessage;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.command.BolusExtraCommand;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.command.BolusExtraCommand;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.command.SetInsulinScheduleCommand;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.command.SetInsulinScheduleCommand;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.response.StatusResponse;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.response.StatusResponse;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.schedule.BolusDeliverySchedule;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.schedule.BolusDeliverySchedule;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.ActionInitializationException;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.manager.PodStateManager;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.manager.PodStateManager;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.rileylink.OmnipodRileyLinkCommunicationManager;
|
||||||
|
|
||||||
public class BolusAction implements OmnipodAction<StatusResponse> {
|
public class BolusAction implements OmnipodAction<StatusResponse> {
|
||||||
private final PodStateManager podStateManager;
|
private final PodStateManager podStateManager;
|
||||||
|
|
|
@ -4,15 +4,15 @@ import java.util.ArrayList;
|
||||||
import java.util.EnumSet;
|
import java.util.EnumSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.rileylink.OmnipodRileyLinkCommunicationManager;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.ActionInitializationException;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.MessageBlock;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.MessageBlock;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.OmnipodMessage;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.OmnipodMessage;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.command.CancelDeliveryCommand;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.command.CancelDeliveryCommand;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.response.StatusResponse;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.response.StatusResponse;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.BeepType;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.BeepType;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.DeliveryType;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.DeliveryType;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.ActionInitializationException;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.manager.PodStateManager;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.manager.PodStateManager;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.rileylink.OmnipodRileyLinkCommunicationManager;
|
||||||
|
|
||||||
public class CancelDeliveryAction implements OmnipodAction<StatusResponse> {
|
public class CancelDeliveryAction implements OmnipodAction<StatusResponse> {
|
||||||
private final PodStateManager podStateManager;
|
private final PodStateManager podStateManager;
|
||||||
|
|
|
@ -2,12 +2,12 @@ package info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.act
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.rileylink.OmnipodRileyLinkCommunicationManager;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.ActionInitializationException;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.command.ConfigureAlertsCommand;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.command.ConfigureAlertsCommand;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.response.StatusResponse;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.response.StatusResponse;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.AlertConfiguration;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.AlertConfiguration;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.ActionInitializationException;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.manager.PodStateManager;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.manager.PodStateManager;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.rileylink.OmnipodRileyLinkCommunicationManager;
|
||||||
|
|
||||||
public class ConfigureAlertsAction implements OmnipodAction<StatusResponse> {
|
public class ConfigureAlertsAction implements OmnipodAction<StatusResponse> {
|
||||||
private final PodStateManager podStateManager;
|
private final PodStateManager podStateManager;
|
||||||
|
|
|
@ -2,13 +2,13 @@ package info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.act
|
||||||
|
|
||||||
import java.util.EnumSet;
|
import java.util.EnumSet;
|
||||||
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.rileylink.OmnipodRileyLinkCommunicationManager;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.ActionInitializationException;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.PodFaultException;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.command.DeactivatePodCommand;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.command.DeactivatePodCommand;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.response.StatusResponse;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.response.StatusResponse;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.DeliveryType;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.DeliveryType;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.ActionInitializationException;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.PodFaultException;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.manager.PodStateManager;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.manager.PodStateManager;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.rileylink.OmnipodRileyLinkCommunicationManager;
|
||||||
|
|
||||||
public class DeactivatePodAction implements OmnipodAction<StatusResponse> {
|
public class DeactivatePodAction implements OmnipodAction<StatusResponse> {
|
||||||
private final PodStateManager podStateManager;
|
private final PodStateManager podStateManager;
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
package info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.action;
|
package info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.action;
|
||||||
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.rileylink.OmnipodRileyLinkCommunicationManager;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.ActionInitializationException;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.command.GetStatusCommand;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.command.GetStatusCommand;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.response.podinfo.PodInfoResponse;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.response.podinfo.PodInfoResponse;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.PodInfoType;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.PodInfoType;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.ActionInitializationException;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.manager.PodStateManager;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.manager.PodStateManager;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.rileylink.OmnipodRileyLinkCommunicationManager;
|
||||||
|
|
||||||
public class GetPodInfoAction implements OmnipodAction<PodInfoResponse> {
|
public class GetPodInfoAction implements OmnipodAction<PodInfoResponse> {
|
||||||
private final PodStateManager podStateManager;
|
private final PodStateManager podStateManager;
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
package info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.action;
|
package info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.action;
|
||||||
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.rileylink.OmnipodRileyLinkCommunicationManager;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.ActionInitializationException;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.command.GetStatusCommand;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.command.GetStatusCommand;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.response.StatusResponse;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.response.StatusResponse;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.PodInfoType;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.PodInfoType;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.ActionInitializationException;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.manager.PodStateManager;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.manager.PodStateManager;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.rileylink.OmnipodRileyLinkCommunicationManager;
|
||||||
|
|
||||||
public class GetStatusAction implements OmnipodAction<StatusResponse> {
|
public class GetStatusAction implements OmnipodAction<StatusResponse> {
|
||||||
private final PodStateManager podStateManager;
|
private final PodStateManager podStateManager;
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
package info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.action;
|
package info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.action;
|
||||||
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.rileylink.OmnipodRileyLinkCommunicationManager;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.action.service.InsertCannulaService;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.action.service.InsertCannulaService;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.ActionInitializationException;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.IllegalPodProgressException;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.response.StatusResponse;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.response.StatusResponse;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.PodProgressStatus;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.PodProgressStatus;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.schedule.BasalSchedule;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.schedule.BasalSchedule;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.ActionInitializationException;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.IllegalPodProgressException;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.manager.PodStateManager;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.manager.PodStateManager;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.rileylink.OmnipodRileyLinkCommunicationManager;
|
||||||
|
|
||||||
public class InsertCannulaAction implements OmnipodAction<StatusResponse> {
|
public class InsertCannulaAction implements OmnipodAction<StatusResponse> {
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
package info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.action;
|
package info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.action;
|
||||||
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.rileylink.OmnipodRileyLinkCommunicationManager;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.action.service.PrimeService;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.action.service.PrimeService;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.ActionInitializationException;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.IllegalPodProgressException;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.response.StatusResponse;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.response.StatusResponse;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.PodProgressStatus;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.PodProgressStatus;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.ActionInitializationException;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.IllegalPodProgressException;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.manager.PodStateManager;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.manager.PodStateManager;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.rileylink.OmnipodRileyLinkCommunicationManager;
|
||||||
|
|
||||||
public class PrimeAction implements OmnipodAction<StatusResponse> {
|
public class PrimeAction implements OmnipodAction<StatusResponse> {
|
||||||
|
|
||||||
|
|
|
@ -4,14 +4,14 @@ import org.joda.time.Duration;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.rileylink.OmnipodRileyLinkCommunicationManager;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.ActionInitializationException;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.OmnipodMessage;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.OmnipodMessage;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.command.BasalScheduleExtraCommand;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.command.BasalScheduleExtraCommand;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.command.SetInsulinScheduleCommand;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.command.SetInsulinScheduleCommand;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.response.StatusResponse;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.response.StatusResponse;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.schedule.BasalSchedule;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.schedule.BasalSchedule;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.ActionInitializationException;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.manager.PodStateManager;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.manager.PodStateManager;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.rileylink.OmnipodRileyLinkCommunicationManager;
|
||||||
|
|
||||||
public class SetBasalScheduleAction implements OmnipodAction<StatusResponse> {
|
public class SetBasalScheduleAction implements OmnipodAction<StatusResponse> {
|
||||||
private final PodStateManager podStateManager;
|
private final PodStateManager podStateManager;
|
||||||
|
|
|
@ -6,15 +6,15 @@ import org.joda.time.Duration;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.rileylink.OmnipodRileyLinkCommunicationManager;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.ActionInitializationException;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.MessageBlock;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.MessageBlock;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.OmnipodMessage;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.OmnipodMessage;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.command.SetInsulinScheduleCommand;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.command.SetInsulinScheduleCommand;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.command.TempBasalExtraCommand;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.command.TempBasalExtraCommand;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.response.StatusResponse;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.response.StatusResponse;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.manager.PodStateManager;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.OmnipodConstants;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.OmnipodConstants;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.ActionInitializationException;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.manager.PodStateManager;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.rileylink.OmnipodRileyLinkCommunicationManager;
|
||||||
|
|
||||||
public class SetTempBasalAction implements OmnipodAction<StatusResponse> {
|
public class SetTempBasalAction implements OmnipodAction<StatusResponse> {
|
||||||
private final PodStateManager podStateManager;
|
private final PodStateManager podStateManager;
|
||||||
|
|
|
@ -4,16 +4,16 @@ import org.joda.time.DateTime;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.rileylink.OmnipodRileyLinkCommunicationManager;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.IllegalMessageAddressException;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.IllegalPodProgressException;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.IllegalVersionResponseTypeException;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.OmnipodMessage;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.OmnipodMessage;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.command.SetupPodCommand;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.command.SetupPodCommand;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.response.VersionResponse;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.response.VersionResponse;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.PodProgressStatus;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.manager.PodStateManager;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.OmnipodConstants;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.OmnipodConstants;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.PodProgressStatus;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.IllegalMessageAddressException;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.IllegalPodProgressException;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.IllegalVersionResponseTypeException;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.manager.PodStateManager;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.rileylink.OmnipodRileyLinkCommunicationManager;
|
||||||
|
|
||||||
public class SetupPodAction implements OmnipodAction<VersionResponse> {
|
public class SetupPodAction implements OmnipodAction<VersionResponse> {
|
||||||
private final PodStateManager podStateManager;
|
private final PodStateManager podStateManager;
|
||||||
|
|
|
@ -6,16 +6,16 @@ import org.joda.time.Duration;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.rileylink.OmnipodRileyLinkCommunicationManager;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.action.BolusAction;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.action.BolusAction;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.action.ConfigureAlertsAction;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.action.ConfigureAlertsAction;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.action.SetBasalScheduleAction;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.action.SetBasalScheduleAction;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.response.StatusResponse;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.response.StatusResponse;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.AlertConfiguration;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.AlertConfiguration;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.util.AlertConfigurationUtil;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.OmnipodConstants;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.schedule.BasalSchedule;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.schedule.BasalSchedule;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.manager.PodStateManager;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.manager.PodStateManager;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.OmnipodConstants;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.util.AlertConfigurationUtil;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.rileylink.OmnipodRileyLinkCommunicationManager;
|
||||||
|
|
||||||
public class InsertCannulaService {
|
public class InsertCannulaService {
|
||||||
public StatusResponse programInitialBasalSchedule(OmnipodRileyLinkCommunicationManager communicationService,
|
public StatusResponse programInitialBasalSchedule(OmnipodRileyLinkCommunicationManager communicationService,
|
||||||
|
|
|
@ -4,16 +4,16 @@ import org.joda.time.Duration;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.rileylink.OmnipodRileyLinkCommunicationManager;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.action.BolusAction;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.action.BolusAction;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.action.ConfigureAlertsAction;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.action.ConfigureAlertsAction;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.OmnipodMessage;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.OmnipodMessage;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.command.FaultConfigCommand;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.command.FaultConfigCommand;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.response.StatusResponse;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.response.StatusResponse;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.AlertConfiguration;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.AlertConfiguration;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.util.AlertConfigurationUtil;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.manager.PodStateManager;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.OmnipodConstants;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.OmnipodConstants;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.manager.PodStateManager;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.util.AlertConfigurationUtil;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.rileylink.OmnipodRileyLinkCommunicationManager;
|
||||||
|
|
||||||
public class PrimeService {
|
public class PrimeService {
|
||||||
|
|
||||||
|
|
|
@ -4,13 +4,13 @@ import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.command.GetStatusCommand;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.MessageBlockType;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.OmnipodCrc;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.PodInfoType;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.CrcMismatchException;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.CrcMismatchException;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.MessageDecodingException;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.MessageDecodingException;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.NotEnoughDataException;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.NotEnoughDataException;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.command.GetStatusCommand;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.MessageBlockType;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.PodInfoType;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.OmnipodCrc;
|
|
||||||
|
|
||||||
public class OmnipodMessage {
|
public class OmnipodMessage {
|
||||||
|
|
||||||
|
|
|
@ -2,10 +2,10 @@ package info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.mes
|
||||||
|
|
||||||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.data.RLMessage;
|
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.data.RLMessage;
|
||||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.OmnipodCrc;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.PacketType;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.CrcMismatchException;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.CrcMismatchException;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.IllegalPacketTypeException;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.IllegalPacketTypeException;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.PacketType;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.OmnipodCrc;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by andy on 6/1/18.
|
* Created by andy on 6/1/18.
|
||||||
|
|
|
@ -8,9 +8,9 @@ import java.util.List;
|
||||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.MessageBlock;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.MessageBlock;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.MessageBlockType;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.MessageBlockType;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.OmnipodConstants;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.schedule.BasalSchedule;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.schedule.BasalSchedule;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.schedule.RateEntry;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.schedule.RateEntry;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.OmnipodConstants;
|
|
||||||
|
|
||||||
public class BasalScheduleExtraCommand extends MessageBlock {
|
public class BasalScheduleExtraCommand extends MessageBlock {
|
||||||
private final boolean acknowledgementBeep;
|
private final boolean acknowledgementBeep;
|
||||||
|
|
|
@ -3,10 +3,10 @@ package info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.mes
|
||||||
import org.joda.time.Duration;
|
import org.joda.time.Duration;
|
||||||
|
|
||||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.CommandInitializationException;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.MessageBlock;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.MessageBlock;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.MessageBlockType;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.MessageBlockType;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.OmnipodConstants;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.OmnipodConstants;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.CommandInitializationException;
|
||||||
|
|
||||||
public class BolusExtraCommand extends MessageBlock {
|
public class BolusExtraCommand extends MessageBlock {
|
||||||
private final boolean acknowledgementBeep;
|
private final boolean acknowledgementBeep;
|
||||||
|
|
|
@ -3,16 +3,16 @@ package info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.mes
|
||||||
import org.joda.time.Duration;
|
import org.joda.time.Duration;
|
||||||
|
|
||||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.CommandInitializationException;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.NonceResyncableMessageBlock;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.NonceResyncableMessageBlock;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.MessageBlockType;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.MessageBlockType;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.OmnipodConstants;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.schedule.BasalDeliverySchedule;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.schedule.BasalDeliverySchedule;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.schedule.BasalDeliveryTable;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.schedule.BasalDeliveryTable;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.schedule.BasalSchedule;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.schedule.BasalSchedule;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.schedule.BolusDeliverySchedule;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.schedule.BolusDeliverySchedule;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.schedule.DeliverySchedule;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.schedule.DeliverySchedule;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.schedule.TempBasalDeliverySchedule;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.schedule.TempBasalDeliverySchedule;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.OmnipodConstants;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.CommandInitializationException;
|
||||||
|
|
||||||
public class SetInsulinScheduleCommand extends NonceResyncableMessageBlock {
|
public class SetInsulinScheduleCommand extends NonceResyncableMessageBlock {
|
||||||
|
|
||||||
|
|
|
@ -6,11 +6,11 @@ import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.CommandInitializationException;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.MessageBlock;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.MessageBlock;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.MessageBlockType;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.MessageBlockType;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.schedule.RateEntry;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.OmnipodConstants;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.OmnipodConstants;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.schedule.RateEntry;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.CommandInitializationException;
|
||||||
|
|
||||||
public class TempBasalExtraCommand extends MessageBlock {
|
public class TempBasalExtraCommand extends MessageBlock {
|
||||||
private final boolean acknowledgementBeep;
|
private final boolean acknowledgementBeep;
|
||||||
|
|
|
@ -10,8 +10,8 @@ import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.mess
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.AlertSet;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.AlertSet;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.DeliveryStatus;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.DeliveryStatus;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.MessageBlockType;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.MessageBlockType;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.PodProgressStatus;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.OmnipodConstants;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.OmnipodConstants;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.PodProgressStatus;
|
||||||
|
|
||||||
public class StatusResponse extends MessageBlock {
|
public class StatusResponse extends MessageBlock {
|
||||||
private static final int MESSAGE_LENGTH = 10;
|
private static final int MESSAGE_LENGTH = 10;
|
||||||
|
@ -20,6 +20,7 @@ public class StatusResponse extends MessageBlock {
|
||||||
private final PodProgressStatus podProgressStatus;
|
private final PodProgressStatus podProgressStatus;
|
||||||
private final Duration timeActive;
|
private final Duration timeActive;
|
||||||
private final Double reservoirLevel;
|
private final Double reservoirLevel;
|
||||||
|
private final int ticksDelivered;
|
||||||
private final double insulinDelivered;
|
private final double insulinDelivered;
|
||||||
private final double insulinNotDelivered;
|
private final double insulinNotDelivered;
|
||||||
private final byte podMessageCounter;
|
private final byte podMessageCounter;
|
||||||
|
@ -40,7 +41,8 @@ public class StatusResponse extends MessageBlock {
|
||||||
int highInsulinBits = (encodedData[2] & 0xF) << 9;
|
int highInsulinBits = (encodedData[2] & 0xF) << 9;
|
||||||
int middleInsulinBits = ByteUtil.convertUnsignedByteToInt(encodedData[3]) << 1;
|
int middleInsulinBits = ByteUtil.convertUnsignedByteToInt(encodedData[3]) << 1;
|
||||||
int lowInsulinBits = ByteUtil.convertUnsignedByteToInt(encodedData[4]) >>> 7;
|
int lowInsulinBits = ByteUtil.convertUnsignedByteToInt(encodedData[4]) >>> 7;
|
||||||
insulinDelivered = OmnipodConstants.POD_PULSE_SIZE * (highInsulinBits | middleInsulinBits | lowInsulinBits);
|
ticksDelivered = (highInsulinBits | middleInsulinBits | lowInsulinBits);
|
||||||
|
insulinDelivered = OmnipodConstants.POD_PULSE_SIZE * ticksDelivered;
|
||||||
podMessageCounter = (byte) ((encodedData[4] >>> 3) & 0xf);
|
podMessageCounter = (byte) ((encodedData[4] >>> 3) & 0xf);
|
||||||
|
|
||||||
insulinNotDelivered = OmnipodConstants.POD_PULSE_SIZE * (((encodedData[4] & 0x03) << 8) | ByteUtil.convertUnsignedByteToInt(encodedData[5]));
|
insulinNotDelivered = OmnipodConstants.POD_PULSE_SIZE * (((encodedData[4] & 0x03) << 8) | ByteUtil.convertUnsignedByteToInt(encodedData[5]));
|
||||||
|
@ -75,6 +77,10 @@ public class StatusResponse extends MessageBlock {
|
||||||
return reservoirLevel;
|
return reservoirLevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getTicksDelivered() {
|
||||||
|
return ticksDelivered;
|
||||||
|
}
|
||||||
|
|
||||||
public double getInsulinDelivered() {
|
public double getInsulinDelivered() {
|
||||||
return insulinDelivered;
|
return insulinDelivered;
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,8 +8,8 @@ import java.util.List;
|
||||||
|
|
||||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.AlertSlot;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.AlertSlot;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.PodInfoType;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.OmnipodConstants;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.OmnipodConstants;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.PodInfoType;
|
||||||
|
|
||||||
public class PodInfoActiveAlerts extends PodInfo {
|
public class PodInfoActiveAlerts extends PodInfo {
|
||||||
private static final int MINIMUM_MESSAGE_LENGTH = 11;
|
private static final int MINIMUM_MESSAGE_LENGTH = 11;
|
||||||
|
|
|
@ -7,9 +7,9 @@ import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.AlertSe
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.DeliveryStatus;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.DeliveryStatus;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.FaultEventCode;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.FaultEventCode;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.LogEventErrorCode;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.LogEventErrorCode;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.OmnipodConstants;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.PodInfoType;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.PodInfoType;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.PodProgressStatus;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.PodProgressStatus;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.OmnipodConstants;
|
|
||||||
|
|
||||||
public class PodInfoFaultEvent extends PodInfo {
|
public class PodInfoFaultEvent extends PodInfo {
|
||||||
private static final int MINIMUM_MESSAGE_LENGTH = 21;
|
private static final int MINIMUM_MESSAGE_LENGTH = 21;
|
||||||
|
|
|
@ -2,8 +2,6 @@ package info.nightscout.androidaps.plugins.pump.omnipod.driver.definition;
|
||||||
|
|
||||||
import org.joda.time.Duration;
|
import org.joda.time.Duration;
|
||||||
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.R;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by andy on 4.8.2019
|
* Created by andy on 4.8.2019
|
||||||
*/
|
*/
|
||||||
|
@ -30,4 +28,5 @@ public class OmnipodConstants {
|
||||||
|
|
||||||
public static final double POD_PRIME_BOLUS_UNITS = 2.6;
|
public static final double POD_PRIME_BOLUS_UNITS = 2.6;
|
||||||
public static final double POD_CANNULA_INSERTION_BOLUS_UNITS = 0.5;
|
public static final double POD_CANNULA_INSERTION_BOLUS_UNITS = 0.5;
|
||||||
|
public static final double POD_SETUP_UNITS = POD_PRIME_BOLUS_UNITS + POD_CANNULA_INSERTION_BOLUS_UNITS;
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,6 @@ import java.util.function.Supplier;
|
||||||
|
|
||||||
import info.nightscout.androidaps.logging.AAPSLogger;
|
import info.nightscout.androidaps.logging.AAPSLogger;
|
||||||
import info.nightscout.androidaps.logging.LTag;
|
import info.nightscout.androidaps.logging.LTag;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.rileylink.OmnipodRileyLinkCommunicationManager;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.action.AcknowledgeAlertsAction;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.action.AcknowledgeAlertsAction;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.action.AssignAddressAction;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.action.AssignAddressAction;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.action.BolusAction;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.action.BolusAction;
|
||||||
|
@ -27,12 +26,6 @@ import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.acti
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.action.SetupPodAction;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.action.SetupPodAction;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.action.service.InsertCannulaService;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.action.service.InsertCannulaService;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.action.service.PrimeService;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.action.service.PrimeService;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.CommunicationException;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.IllegalDeliveryStatusException;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.IllegalPacketTypeException;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.IllegalPodProgressException;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.NonceOutOfSyncException;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.PodFaultException;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.command.CancelDeliveryCommand;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.command.CancelDeliveryCommand;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.response.StatusResponse;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.response.StatusResponse;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.response.podinfo.PodInfoRecentPulseLog;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.response.podinfo.PodInfoRecentPulseLog;
|
||||||
|
@ -40,12 +33,19 @@ import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.mess
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.BeepType;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.BeepType;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.DeliveryStatus;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.DeliveryStatus;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.DeliveryType;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.DeliveryType;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.OmnipodConstants;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.PacketType;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.PacketType;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.PodInfoType;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.PodInfoType;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.PodProgressStatus;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.PodProgressStatus;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.schedule.BasalSchedule;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.schedule.BasalSchedule;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.CommunicationException;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.IllegalDeliveryStatusException;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.IllegalPacketTypeException;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.IllegalPodProgressException;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.NonceOutOfSyncException;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.OmnipodException;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.OmnipodException;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.OmnipodConstants;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.PodFaultException;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.rileylink.OmnipodRileyLinkCommunicationManager;
|
||||||
import info.nightscout.androidaps.utils.sharedPreferences.SP;
|
import info.nightscout.androidaps.utils.sharedPreferences.SP;
|
||||||
import io.reactivex.Completable;
|
import io.reactivex.Completable;
|
||||||
import io.reactivex.Flowable;
|
import io.reactivex.Flowable;
|
||||||
|
|
|
@ -303,6 +303,10 @@ public abstract class PodStateManager {
|
||||||
return getSafe(() -> podState.getReservoirLevel());
|
return getSafe(() -> podState.getReservoirLevel());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public final Double getTotalInsulinDelivered() {
|
||||||
|
return getSafe(() -> podState.getTotalInsulinDelivered());
|
||||||
|
}
|
||||||
|
|
||||||
public final Duration getScheduleOffset() {
|
public final Duration getScheduleOffset() {
|
||||||
DateTime now = getTime();
|
DateTime now = getTime();
|
||||||
return new Duration(now.withTimeAtStartOfDay(), now);
|
return new Duration(now.withTimeAtStartOfDay(), now);
|
||||||
|
@ -374,6 +378,7 @@ public abstract class PodStateManager {
|
||||||
podState.setActiveAlerts(statusResponse.getAlerts());
|
podState.setActiveAlerts(statusResponse.getAlerts());
|
||||||
podState.setLastDeliveryStatus(statusResponse.getDeliveryStatus());
|
podState.setLastDeliveryStatus(statusResponse.getDeliveryStatus());
|
||||||
podState.setReservoirLevel(statusResponse.getReservoirLevel());
|
podState.setReservoirLevel(statusResponse.getReservoirLevel());
|
||||||
|
podState.setTotalTicksDelivered(statusResponse.getTicksDelivered());
|
||||||
podState.setPodProgressStatus(statusResponse.getPodProgressStatus());
|
podState.setPodProgressStatus(statusResponse.getPodProgressStatus());
|
||||||
podState.setLastUpdatedFromStatusResponse(DateTime.now());
|
podState.setLastUpdatedFromStatusResponse(DateTime.now());
|
||||||
});
|
});
|
||||||
|
@ -470,6 +475,7 @@ public abstract class PodStateManager {
|
||||||
private DateTime expiresAt;
|
private DateTime expiresAt;
|
||||||
private PodInfoFaultEvent faultEvent;
|
private PodInfoFaultEvent faultEvent;
|
||||||
private Double reservoirLevel;
|
private Double reservoirLevel;
|
||||||
|
private Integer totalTicksDelivered;
|
||||||
private boolean suspended;
|
private boolean suspended;
|
||||||
private NonceState nonceState;
|
private NonceState nonceState;
|
||||||
private PodProgressStatus podProgressStatus;
|
private PodProgressStatus podProgressStatus;
|
||||||
|
@ -603,6 +609,22 @@ public abstract class PodStateManager {
|
||||||
this.reservoirLevel = reservoirLevel;
|
this.reservoirLevel = reservoirLevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Integer getTotalTicksDelivered() {
|
||||||
|
return totalTicksDelivered;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getTotalInsulinDelivered() {
|
||||||
|
if (totalTicksDelivered != null) {
|
||||||
|
return totalTicksDelivered * OmnipodConstants.POD_PULSE_SIZE;
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void setTotalTicksDelivered(Integer totalTicksDelivered) {
|
||||||
|
this.totalTicksDelivered = totalTicksDelivered;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isSuspended() {
|
public boolean isSuspended() {
|
||||||
return suspended;
|
return suspended;
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,8 +36,18 @@ import info.nightscout.androidaps.plugins.pump.common.data.TempBasalPair;
|
||||||
import info.nightscout.androidaps.plugins.pump.common.defs.PumpType;
|
import info.nightscout.androidaps.plugins.pump.common.defs.PumpType;
|
||||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.R;
|
import info.nightscout.androidaps.plugins.pump.omnipod.R;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.data.ActiveBolus;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.definition.OmnipodStorageKeys;
|
import info.nightscout.androidaps.plugins.pump.omnipod.definition.OmnipodStorageKeys;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.manager.OmnipodManager;
|
import info.nightscout.androidaps.plugins.pump.omnipod.definition.PodHistoryEntryType;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.definition.PodInitActionType;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.definition.PodInitReceiver;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.response.StatusResponse;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.response.podinfo.PodInfoRecentPulseLog;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.response.podinfo.PodInfoResponse;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.FaultEventCode;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.PodInfoType;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.schedule.BasalSchedule;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.schedule.BasalScheduleEntry;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.ActionInitializationException;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.ActionInitializationException;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.CommandInitializationException;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.CommandInitializationException;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.CommunicationException;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.CommunicationException;
|
||||||
|
@ -53,20 +63,11 @@ import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.MessageD
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.NonceOutOfSyncException;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.NonceOutOfSyncException;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.NonceResyncException;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.NonceResyncException;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.NotEnoughDataException;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.NotEnoughDataException;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.OmnipodException;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.PodFaultException;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.PodFaultException;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.PodReturnedErrorResponseException;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.PodReturnedErrorResponseException;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.response.StatusResponse;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.manager.OmnipodManager;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.response.podinfo.PodInfoRecentPulseLog;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.response.podinfo.PodInfoResponse;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.FaultEventCode;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.PodInfoType;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.definition.PodInitActionType;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.definition.PodInitReceiver;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.schedule.BasalSchedule;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.schedule.BasalScheduleEntry;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.manager.PodStateManager;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.manager.PodStateManager;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.definition.PodHistoryEntryType;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.OmnipodException;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.manager.SetupActionResult;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.manager.SetupActionResult;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.rileylink.OmnipodRileyLinkCommunicationManager;
|
import info.nightscout.androidaps.plugins.pump.omnipod.rileylink.OmnipodRileyLinkCommunicationManager;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.util.AapsOmnipodUtil;
|
import info.nightscout.androidaps.plugins.pump.omnipod.util.AapsOmnipodUtil;
|
||||||
|
@ -309,9 +310,11 @@ public class AapsOmnipodManager {
|
||||||
//
|
//
|
||||||
// I discussed this with the AAPS team but nobody seems to care so we're stuck with this ugly workaround for now
|
// I discussed this with the AAPS team but nobody seems to care so we're stuck with this ugly workaround for now
|
||||||
try {
|
try {
|
||||||
sp.putString(OmnipodStorageKeys.Prefs.CurrentBolus, aapsOmnipodUtil.getGsonInstance().toJson(detailedBolusInfo));
|
ActiveBolus activeBolus = ActiveBolus.fromDetailedBolusInfo(detailedBolusInfo);
|
||||||
|
sp.putString(OmnipodStorageKeys.Prefs.ActiveBolus, aapsOmnipodUtil.getGsonInstance().toJson(activeBolus));
|
||||||
|
aapsLogger.debug(LTag.PUMP, "Stored active bolus to SP for recovery");
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
aapsLogger.error(LTag.PUMP, "Failed to store current bolus to SP", ex);
|
aapsLogger.error(LTag.PUMP, "Failed to store active bolus to SP", ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Wait for the bolus to finish
|
// Wait for the bolus to finish
|
||||||
|
@ -322,7 +325,7 @@ public class AapsOmnipodManager {
|
||||||
|
|
||||||
addBolusToHistory(detailedBolusInfo);
|
addBolusToHistory(detailedBolusInfo);
|
||||||
|
|
||||||
sp.remove(OmnipodStorageKeys.Prefs.CurrentBolus);
|
sp.remove(OmnipodStorageKeys.Prefs.ActiveBolus);
|
||||||
|
|
||||||
return new PumpEnactResult(injector).success(true).enacted(true).bolusDelivered(detailedBolusInfo.insulin);
|
return new PumpEnactResult(injector).success(true).enacted(true).bolusDelivered(detailedBolusInfo.insulin);
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,7 @@ import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.Riley
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.OmnipodPumpPlugin
|
import info.nightscout.androidaps.plugins.pump.omnipod.OmnipodPumpPlugin
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.R
|
import info.nightscout.androidaps.plugins.pump.omnipod.R
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.definition.OmnipodStatusRequestType
|
import info.nightscout.androidaps.plugins.pump.omnipod.definition.OmnipodStatusRequestType
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.OmnipodConstants
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.PodProgressStatus
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.PodProgressStatus
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.manager.PodStateManager
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.manager.PodStateManager
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.event.EventOmnipodPodStateActionsAllowedChanged
|
import info.nightscout.androidaps.plugins.pump.omnipod.event.EventOmnipodPodStateActionsAllowedChanged
|
||||||
|
@ -216,6 +217,7 @@ class OmnipodFragment : DaggerFragment() {
|
||||||
omnipod_pod_firmware_version.text = "-"
|
omnipod_pod_firmware_version.text = "-"
|
||||||
omnipod_pod_expiry.text = "-"
|
omnipod_pod_expiry.text = "-"
|
||||||
omnipod_base_basal_rate.text = "-"
|
omnipod_base_basal_rate.text = "-"
|
||||||
|
omnipod_total_delivered.text = "-"
|
||||||
omnipod_reservoir.text = "-"
|
omnipod_reservoir.text = "-"
|
||||||
omnipod_tempbasal.text = "-"
|
omnipod_tempbasal.text = "-"
|
||||||
omnipod_lastbolus.text = "-"
|
omnipod_lastbolus.text = "-"
|
||||||
|
@ -247,6 +249,13 @@ class OmnipodFragment : DaggerFragment() {
|
||||||
omnipod_tempbasal.text = activePlugin.activeTreatments
|
omnipod_tempbasal.text = activePlugin.activeTreatments
|
||||||
.getTempBasalFromHistory(System.currentTimeMillis())?.toStringFull() ?: "-"
|
.getTempBasalFromHistory(System.currentTimeMillis())?.toStringFull() ?: "-"
|
||||||
|
|
||||||
|
// total delivered
|
||||||
|
omnipod_total_delivered.text = if (podStateManager.isPodActivationCompleted && podStateManager.totalInsulinDelivered != null) { // Null check for backwards compatibility
|
||||||
|
resourceHelper.gs(R.string.omnipod_total_delivered, podStateManager.totalInsulinDelivered - OmnipodConstants.POD_SETUP_UNITS);
|
||||||
|
} else {
|
||||||
|
"-"
|
||||||
|
}
|
||||||
|
|
||||||
// reservoir
|
// reservoir
|
||||||
if (podStateManager.reservoirLevel == null) {
|
if (podStateManager.reservoirLevel == null) {
|
||||||
omnipod_reservoir.text = resourceHelper.gs(R.string.omnipod_reservoir_over50)
|
omnipod_reservoir.text = resourceHelper.gs(R.string.omnipod_reservoir_over50)
|
||||||
|
|
|
@ -18,12 +18,12 @@ import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.Riley
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.R
|
import info.nightscout.androidaps.plugins.pump.omnipod.R
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.PodProgressStatus
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.PodProgressStatus
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.manager.PodStateManager
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.manager.PodStateManager
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.manager.AapsOmnipodManager
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard.defs.PodActionType
|
import info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard.defs.PodActionType
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard.model.FullInitPodWizardModel
|
import info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard.model.FullInitPodWizardModel
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard.model.RemovePodWizardModel
|
import info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard.model.RemovePodWizardModel
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard.model.ShortInitPodWizardModel
|
import info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard.model.ShortInitPodWizardModel
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard.pages.InitPodRefreshAction
|
import info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard.pages.InitPodRefreshAction
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.manager.AapsOmnipodManager
|
|
||||||
import info.nightscout.androidaps.utils.FabricPrivacy
|
import info.nightscout.androidaps.utils.FabricPrivacy
|
||||||
import info.nightscout.androidaps.utils.alertDialogs.OKDialog
|
import info.nightscout.androidaps.utils.alertDialogs.OKDialog
|
||||||
import info.nightscout.androidaps.utils.extensions.plusAssign
|
import info.nightscout.androidaps.utils.extensions.plusAssign
|
||||||
|
|
|
@ -517,6 +517,42 @@
|
||||||
android:layout_marginBottom="5dp"
|
android:layout_marginBottom="5dp"
|
||||||
android:background="@color/listdelimiter" />
|
android:background="@color/listdelimiter" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1.5"
|
||||||
|
android:gravity="end"
|
||||||
|
android:paddingRight="5dp"
|
||||||
|
android:text="@string/omnipod_total_delivered_label"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="5dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="0"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:paddingStart="2dp"
|
||||||
|
android:paddingEnd="2dp"
|
||||||
|
android:text=":"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/omnipod_total_delivered"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:gravity="start"
|
||||||
|
android:paddingLeft="5dp"
|
||||||
|
android:textColor="@android:color/white"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
|
@ -26,6 +26,8 @@
|
||||||
<string name="omnipod_moments_ago">Moments ago</string>
|
<string name="omnipod_moments_ago">Moments ago</string>
|
||||||
<string name="omnipod_pod_mgmt">Pod Mgmt</string>
|
<string name="omnipod_pod_mgmt">Pod Mgmt</string>
|
||||||
<string name="omnipod_pod_status">Pod Status</string>
|
<string name="omnipod_pod_status">Pod Status</string>
|
||||||
|
<string name="omnipod_total_delivered_label">Total Delivered</string>
|
||||||
|
<string name="omnipod_total_delivered">%1$.2f U</string>
|
||||||
<string name="omnipod_reservoir_left">%1$.2f U left</string>
|
<string name="omnipod_reservoir_left">%1$.2f U left</string>
|
||||||
<string name="omnipod_reservoir_over50">Over 50 U</string>
|
<string name="omnipod_reservoir_over50">Over 50 U</string>
|
||||||
<string name="omnipod_pod_address">Pod Address</string>
|
<string name="omnipod_pod_address">Pod Address</string>
|
||||||
|
|
|
@ -45,6 +45,7 @@ public class StatusResponseTest {
|
||||||
assertEquals(PodProgressStatus.ABOVE_FIFTY_UNITS, statusResponse.getPodProgressStatus());
|
assertEquals(PodProgressStatus.ABOVE_FIFTY_UNITS, statusResponse.getPodProgressStatus());
|
||||||
assertNull("Reservoir level should be null", statusResponse.getReservoirLevel());
|
assertNull("Reservoir level should be null", statusResponse.getReservoirLevel());
|
||||||
assertEquals(Duration.standardMinutes(1307).getMillis(), statusResponse.getTimeActive().getMillis());
|
assertEquals(Duration.standardMinutes(1307).getMillis(), statusResponse.getTimeActive().getMillis());
|
||||||
|
assertEquals(1201, statusResponse.getTicksDelivered());
|
||||||
assertEquals(60.05, statusResponse.getInsulinDelivered(), 0.000001);
|
assertEquals(60.05, statusResponse.getInsulinDelivered(), 0.000001);
|
||||||
assertEquals(15, statusResponse.getPodMessageCounter());
|
assertEquals(15, statusResponse.getPodMessageCounter());
|
||||||
assertEquals(0, statusResponse.getInsulinNotDelivered(), 0.000001);
|
assertEquals(0, statusResponse.getInsulinNotDelivered(), 0.000001);
|
||||||
|
@ -62,6 +63,7 @@ public class StatusResponseTest {
|
||||||
assertEquals(PodProgressStatus.FIFTY_OR_LESS_UNITS, statusResponse.getPodProgressStatus());
|
assertEquals(PodProgressStatus.FIFTY_OR_LESS_UNITS, statusResponse.getPodProgressStatus());
|
||||||
assertEquals(24.4, statusResponse.getReservoirLevel(), 0.000001);
|
assertEquals(24.4, statusResponse.getReservoirLevel(), 0.000001);
|
||||||
assertEquals(Duration.standardMinutes(4261).getMillis(), statusResponse.getTimeActive().getMillis());
|
assertEquals(Duration.standardMinutes(4261).getMillis(), statusResponse.getTimeActive().getMillis());
|
||||||
|
assertEquals(3134, statusResponse.getTicksDelivered());
|
||||||
assertEquals(156.7, statusResponse.getInsulinDelivered(), 0.000001);
|
assertEquals(156.7, statusResponse.getInsulinDelivered(), 0.000001);
|
||||||
assertEquals(13, statusResponse.getPodMessageCounter());
|
assertEquals(13, statusResponse.getPodMessageCounter());
|
||||||
assertEquals(0, statusResponse.getInsulinNotDelivered(), 0.000001);
|
assertEquals(0, statusResponse.getInsulinNotDelivered(), 0.000001);
|
||||||
|
@ -80,6 +82,8 @@ public class StatusResponseTest {
|
||||||
assertEquals(OmnipodConstants.POD_PULSE_SIZE * 1023, statusResponse.getInsulinNotDelivered(), 0.000001);
|
assertEquals(OmnipodConstants.POD_PULSE_SIZE * 1023, statusResponse.getInsulinNotDelivered(), 0.000001);
|
||||||
assertNull("Reservoir level should be null", statusResponse.getReservoirLevel());
|
assertNull("Reservoir level should be null", statusResponse.getReservoirLevel());
|
||||||
assertEquals(OmnipodConstants.POD_PULSE_SIZE * 8191, statusResponse.getInsulinDelivered(), 0.0000001);
|
assertEquals(OmnipodConstants.POD_PULSE_SIZE * 8191, statusResponse.getInsulinDelivered(), 0.0000001);
|
||||||
|
assertEquals(8191, statusResponse.getTicksDelivered());
|
||||||
|
assertEquals(OmnipodConstants.POD_PULSE_SIZE * 8191, statusResponse.getInsulinDelivered(), 0.0000001);
|
||||||
assertEquals(15, statusResponse.getPodMessageCounter());
|
assertEquals(15, statusResponse.getPodMessageCounter());
|
||||||
assertEquals(8, statusResponse.getAlerts().getAlertSlots().size());
|
assertEquals(8, statusResponse.getAlerts().getAlertSlots().size());
|
||||||
|
|
||||||
|
@ -94,6 +98,7 @@ public class StatusResponseTest {
|
||||||
assertTrue(Duration.standardMinutes(3547).isEqual(statusResponse.getTimeActive()));
|
assertTrue(Duration.standardMinutes(3547).isEqual(statusResponse.getTimeActive()));
|
||||||
assertEquals(DeliveryStatus.NORMAL, statusResponse.getDeliveryStatus());
|
assertEquals(DeliveryStatus.NORMAL, statusResponse.getDeliveryStatus());
|
||||||
assertEquals(PodProgressStatus.FIFTY_OR_LESS_UNITS, statusResponse.getPodProgressStatus());
|
assertEquals(PodProgressStatus.FIFTY_OR_LESS_UNITS, statusResponse.getPodProgressStatus());
|
||||||
|
assertEquals(2589, statusResponse.getTicksDelivered());
|
||||||
assertEquals(129.45, statusResponse.getInsulinDelivered(), 0.00001);
|
assertEquals(129.45, statusResponse.getInsulinDelivered(), 0.00001);
|
||||||
assertEquals(46.00, statusResponse.getReservoirLevel(), 0.00001);
|
assertEquals(46.00, statusResponse.getReservoirLevel(), 0.00001);
|
||||||
assertEquals(2.2, statusResponse.getInsulinNotDelivered(), 0.0001);
|
assertEquals(2.2, statusResponse.getInsulinNotDelivered(), 0.0001);
|
||||||
|
|
Loading…
Reference in a new issue