Store PodProgressStatus in PodState
This commit is contained in:
parent
ef05654133
commit
b5d55adb2e
1 changed files with 22 additions and 0 deletions
|
@ -25,6 +25,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.defs.AlertSlot;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.defs.AlertType;
|
import info.nightscout.androidaps.plugins.pump.omnipod.defs.AlertType;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.defs.DeliveryStatus;
|
import info.nightscout.androidaps.plugins.pump.omnipod.defs.DeliveryStatus;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.defs.FirmwareVersion;
|
import info.nightscout.androidaps.plugins.pump.omnipod.defs.FirmwareVersion;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.defs.PodProgressStatus;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.defs.SetupProgress;
|
import info.nightscout.androidaps.plugins.pump.omnipod.defs.SetupProgress;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.defs.schedule.BasalSchedule;
|
import info.nightscout.androidaps.plugins.pump.omnipod.defs.schedule.BasalSchedule;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.util.OmniCRC;
|
import info.nightscout.androidaps.plugins.pump.omnipod.util.OmniCRC;
|
||||||
|
@ -270,6 +271,17 @@ public abstract class PodStateManager {
|
||||||
setAndStore(() -> podState.setSetupProgress(setupProgress));
|
setAndStore(() -> podState.setSetupProgress(setupProgress));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public final PodProgressStatus getPodProgressStatus() {
|
||||||
|
return getSafe(() -> podState.getPodProgressStatus());
|
||||||
|
}
|
||||||
|
|
||||||
|
public final void setPodProgressStatus(PodProgressStatus podProgressStatus) {
|
||||||
|
if (podProgressStatus == null) {
|
||||||
|
throw new IllegalArgumentException("Pod progress status can not be null");
|
||||||
|
}
|
||||||
|
setAndStore(() -> podState.setPodProgressStatus(podProgressStatus));
|
||||||
|
}
|
||||||
|
|
||||||
public final boolean isSuspended() {
|
public final boolean isSuspended() {
|
||||||
return getSafe(() -> podState.isSuspended());
|
return getSafe(() -> podState.isSuspended());
|
||||||
}
|
}
|
||||||
|
@ -353,6 +365,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.setPodProgressStatus(statusResponse.getPodProgressStatus());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -449,6 +462,7 @@ public abstract class PodStateManager {
|
||||||
private boolean suspended;
|
private boolean suspended;
|
||||||
private NonceState nonceState;
|
private NonceState nonceState;
|
||||||
private SetupProgress setupProgress;
|
private SetupProgress setupProgress;
|
||||||
|
private PodProgressStatus podProgressStatus;
|
||||||
private DeliveryStatus lastDeliveryStatus;
|
private DeliveryStatus lastDeliveryStatus;
|
||||||
private AlertSet activeAlerts;
|
private AlertSet activeAlerts;
|
||||||
private BasalSchedule basalSchedule;
|
private BasalSchedule basalSchedule;
|
||||||
|
@ -595,6 +609,14 @@ public abstract class PodStateManager {
|
||||||
this.setupProgress = setupProgress;
|
this.setupProgress = setupProgress;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public PodProgressStatus getPodProgressStatus() {
|
||||||
|
return podProgressStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
void setPodProgressStatus(PodProgressStatus podProgressStatus) {
|
||||||
|
this.podProgressStatus = podProgressStatus;
|
||||||
|
}
|
||||||
|
|
||||||
DeliveryStatus getLastDeliveryStatus() {
|
DeliveryStatus getLastDeliveryStatus() {
|
||||||
return lastDeliveryStatus;
|
return lastDeliveryStatus;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue