Small fixes
This commit is contained in:
parent
f64cc66298
commit
eb5fb334c9
5 changed files with 11 additions and 11 deletions
|
@ -2,8 +2,6 @@ package info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.mes
|
||||||
|
|
||||||
import org.joda.time.Duration;
|
import org.joda.time.Duration;
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
|
|
||||||
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.response.StatusUpdatableResponse;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.response.StatusUpdatableResponse;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.AlertSet;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.AlertSet;
|
||||||
|
@ -185,7 +183,7 @@ public class PodInfoDetailedStatus extends PodInfo implements StatusUpdatableRes
|
||||||
", receiverLowGain=" + receiverLowGain +
|
", receiverLowGain=" + receiverLowGain +
|
||||||
", radioRSSI=" + radioRSSI +
|
", radioRSSI=" + radioRSSI +
|
||||||
", previousPodProgressStatus=" + previousPodProgressStatus +
|
", previousPodProgressStatus=" + previousPodProgressStatus +
|
||||||
", unknownValue=" + Arrays.toString(unknownValue) +
|
", unknownValue=" + ByteUtil.shortHexString(unknownValue) +
|
||||||
'}';
|
'}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ public class IllegalActivationProgressException extends OmnipodException {
|
||||||
private final ActivationProgress actual;
|
private final ActivationProgress actual;
|
||||||
|
|
||||||
public IllegalActivationProgressException(ActivationProgress expected, ActivationProgress actual) {
|
public IllegalActivationProgressException(ActivationProgress expected, ActivationProgress actual) {
|
||||||
super(String.format(Locale.getDefault(), "Illegal setup progress: %s, expected: %s", actual, expected), true);
|
super(String.format(Locale.getDefault(), "Illegal activation progress: %s, expected: %s", actual, expected), true);
|
||||||
this.expected = expected;
|
this.expected = expected;
|
||||||
this.actual = actual;
|
this.actual = actual;
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,7 @@ class PodActivationWizardActivity : OmnipodWizardActivityBase() {
|
||||||
setContentView(R.layout.omnipod_pod_activation_wizard_activity)
|
setContentView(R.layout.omnipod_pod_activation_wizard_activity)
|
||||||
|
|
||||||
startDestination = savedInstanceState?.getInt(KEY_START_DESTINATION, R.id.fillPodInfoFragment)
|
startDestination = savedInstanceState?.getInt(KEY_START_DESTINATION, R.id.fillPodInfoFragment)
|
||||||
?: if (!podStateManager.isPodInitialized || podStateManager.activationProgress.isBefore(ActivationProgress.PRIMING_COMPLETED)) {
|
?: if (podStateManager.activationProgress.isBefore(ActivationProgress.PRIMING_COMPLETED)) {
|
||||||
R.id.fillPodInfoFragment
|
R.id.fillPodInfoFragment
|
||||||
} else {
|
} else {
|
||||||
R.id.attachPodInfoFragment
|
R.id.attachPodInfoFragment
|
||||||
|
|
|
@ -9,6 +9,7 @@ import info.nightscout.androidaps.utils.resources.ResourceHelper
|
||||||
|
|
||||||
open class EventRileyLinkDeviceStatusChange : EventStatus {
|
open class EventRileyLinkDeviceStatusChange : EventStatus {
|
||||||
|
|
||||||
|
var rileyLinkTargetDevice: RileyLinkTargetDevice? = null
|
||||||
var rileyLinkServiceState: RileyLinkServiceState? = null
|
var rileyLinkServiceState: RileyLinkServiceState? = null
|
||||||
var rileyLinkError: RileyLinkError? = null
|
var rileyLinkError: RileyLinkError? = null
|
||||||
|
|
||||||
|
@ -18,7 +19,8 @@ open class EventRileyLinkDeviceStatusChange : EventStatus {
|
||||||
constructor() {
|
constructor() {
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(rileyLinkServiceState: RileyLinkServiceState?, rileyLinkError: RileyLinkError?) {
|
constructor(rileyLinkTargetDevice: RileyLinkTargetDevice, rileyLinkServiceState: RileyLinkServiceState?, rileyLinkError: RileyLinkError?) {
|
||||||
|
this.rileyLinkTargetDevice = rileyLinkTargetDevice
|
||||||
this.rileyLinkServiceState = rileyLinkServiceState
|
this.rileyLinkServiceState = rileyLinkServiceState
|
||||||
this.rileyLinkError = rileyLinkError
|
this.rileyLinkError = rileyLinkError
|
||||||
}
|
}
|
||||||
|
@ -38,7 +40,8 @@ open class EventRileyLinkDeviceStatusChange : EventStatus {
|
||||||
val rileyLinkError = this.rileyLinkError
|
val rileyLinkError = this.rileyLinkError
|
||||||
|
|
||||||
if (rileyLinkServiceState.isError && rileyLinkError != null) {
|
if (rileyLinkServiceState.isError && rileyLinkError != null) {
|
||||||
return resourceHelper.gs(rileyLinkError.getResourceId(RileyLinkTargetDevice.Omnipod))
|
val rileyLinkTargetDevice = this.rileyLinkTargetDevice ?: return ""
|
||||||
|
return resourceHelper.gs(rileyLinkError.getResourceId(rileyLinkTargetDevice))
|
||||||
}
|
}
|
||||||
|
|
||||||
return resourceHelper.gs(resourceId)
|
return resourceHelper.gs(resourceId)
|
||||||
|
|
|
@ -33,8 +33,7 @@ public class RileyLinkServiceData {
|
||||||
public RileyLinkServiceState rileyLinkServiceState = RileyLinkServiceState.NotStarted;
|
public RileyLinkServiceState rileyLinkServiceState = RileyLinkServiceState.NotStarted;
|
||||||
private long lastServiceStateChange = 0L;
|
private long lastServiceStateChange = 0L;
|
||||||
public RileyLinkFirmwareVersion firmwareVersion;
|
public RileyLinkFirmwareVersion firmwareVersion;
|
||||||
public RileyLinkTargetFrequency rileyLinkTargetFrequency; // TODO this might not be correct place
|
public RileyLinkTargetFrequency rileyLinkTargetFrequency;
|
||||||
|
|
||||||
public String rileylinkAddress;
|
public String rileylinkAddress;
|
||||||
long lastTuneUpTime = 0L;
|
long lastTuneUpTime = 0L;
|
||||||
public Double lastGoodFrequency;
|
public Double lastGoodFrequency;
|
||||||
|
@ -44,7 +43,7 @@ public class RileyLinkServiceData {
|
||||||
// radio version
|
// radio version
|
||||||
public RileyLinkFirmwareVersion versionCC110;
|
public RileyLinkFirmwareVersion versionCC110;
|
||||||
|
|
||||||
public RileyLinkTargetDevice targetDevice; // TODO this might not be correct place
|
public RileyLinkTargetDevice targetDevice;
|
||||||
|
|
||||||
// Medtronic Pump
|
// Medtronic Pump
|
||||||
public String pumpID;
|
public String pumpID;
|
||||||
|
@ -86,7 +85,7 @@ public class RileyLinkServiceData {
|
||||||
aapsLogger.info(LTag.PUMP, "RileyLink State Changed: {} {}", newState, errorCode == null ? "" : " - Error State: " + errorCode.name());
|
aapsLogger.info(LTag.PUMP, "RileyLink State Changed: {} {}", newState, errorCode == null ? "" : " - Error State: " + errorCode.name());
|
||||||
|
|
||||||
rileyLinkUtil.getRileyLinkHistory().add(new RLHistoryItem(rileyLinkServiceState, errorCode, targetDevice));
|
rileyLinkUtil.getRileyLinkHistory().add(new RLHistoryItem(rileyLinkServiceState, errorCode, targetDevice));
|
||||||
rxBus.send(new EventRileyLinkDeviceStatusChange(newState, errorCode));
|
rxBus.send(new EventRileyLinkDeviceStatusChange(targetDevice, newState, errorCode));
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue