- added real pod status to pod status

This commit is contained in:
Andy Rozman 2020-08-01 19:54:58 +01:00
parent 54d30cd8c4
commit faeb2576a9
2 changed files with 16 additions and 41 deletions

View file

@ -264,7 +264,7 @@ class OmnipodFragment : DaggerFragment() {
} else if (driverState == OmnipodDriverState.Initalized_PodInitializing) {
omnipod_pod_address.text = omnipodPumpStatus.podSessionState.address.toString()
omnipod_pod_expiry.text = "-"
omnipod_pod_status.text = omnipodPumpStatus.podSessionState.getSetupProgress().name
omnipod_pod_status.text = resourceHelper.gs(R.string.omnipod_pod_status_initalizing) + " (" + omnipodPumpStatus.podSessionState.getSetupProgress().name + ")"
omnipodPumpStatus.podAvailable = false
omnipodPumpStatus.podNumber == omnipodPumpStatus.podSessionState.address.toString()
} else {
@ -279,19 +279,20 @@ class OmnipodFragment : DaggerFragment() {
var podDeviceState = omnipodPumpStatus.podDeviceState
var stateText : String?
when (podDeviceState) {
null,
PodDeviceState.Sleeping -> omnipod_pod_status.text = "{fa-bed} " // + pumpStatus.pumpDeviceState.name());
PodDeviceState.Sleeping -> stateText = "{fa-bed} " // + pumpStatus.pumpDeviceState.name());
PodDeviceState.NeverContacted,
PodDeviceState.WakingUp,
PodDeviceState.PumpUnreachable,
PodDeviceState.ErrorWhenCommunicating,
PodDeviceState.TimeoutWhenCommunicating,
PodDeviceState.InvalidConfiguration -> omnipod_pod_status.text = " " + resourceHelper.gs(podDeviceState.resourceId)
PodDeviceState.InvalidConfiguration -> stateText = " " + resourceHelper.gs(podDeviceState.resourceId)
PodDeviceState.Active -> {
omnipod_pod_status.text = "Active";
PodDeviceState.Active -> {
stateText = resourceHelper.gs(R.string.omnipod_pod_status_active)
// val cmd = OmnipodUtil.getCurrentCommand()
// if (cmd == null)
// omnipod_pod_status.text = " " + resourceHelper.gs(pumpStatus.pumpDeviceState.resourceId)
@ -309,45 +310,15 @@ class OmnipodFragment : DaggerFragment() {
// }
// }
}
else -> aapsLogger.warn(LTag.PUMP, "Unknown pump state: " + omnipodPumpStatus.podDeviceState)
else -> {
aapsLogger.warn(LTag.PUMP, "Unknown pump state: " + omnipodPumpStatus.podDeviceState)
stateText = resourceHelper.gs(R.string.omnipod_pod_status_unknown)
}
}
omnipod_pod_status.text = stateText + " (" + omnipodPumpStatus.podSessionState.getSetupProgress().name + ")"
}
// pumpStatus.pumpDeviceState = checkStatusSet(pumpStatus.pumpDeviceState,
// OmnipodUtil.getPumpDeviceState()) as PumpDeviceState?
//
// when (pumpStatus.pumpDeviceState) {
// null,
// PumpDeviceState.Sleeping -> omnipod_pod_status.text = "{fa-bed} " // + pumpStatus.pumpDeviceState.name());
// PumpDeviceState.NeverContacted,
// PumpDeviceState.WakingUp,
// PumpDeviceState.PumpUnreachable,
// PumpDeviceState.ErrorWhenCommunicating,
// PumpDeviceState.TimeoutWhenCommunicating,
// PumpDeviceState.InvalidConfiguration -> omnipod_pod_status.text = " " + resourceHelper.gs(pumpStatus.pumpDeviceState.resourceId)
// PumpDeviceState.Active -> {
// val cmd = OmnipodUtil.getCurrentCommand()
// if (cmd == null)
// omnipod_pod_status.text = " " + resourceHelper.gs(pumpStatus.pumpDeviceState.resourceId)
// else {
// aapsLogger.debug(LTag.PUMP,"Command: " + cmd)
// val cmdResourceId = cmd.resourceId
// if (cmd == MedtronicCommandType.GetHistoryData) {
// omnipod_pod_status.text = OmnipodUtil.frameNumber?.let {
// resourceHelper.gs(cmdResourceId, OmnipodUtil.pageNumber, OmnipodUtil.frameNumber)
// }
// ?: resourceHelper.gs(R.string.medtronic_cmd_desc_get_history_request, OmnipodUtil.pageNumber)
// } else {
// omnipod_pod_status.text = " " + (cmdResourceId?.let { resourceHelper.gs(it) }
// ?: cmd.getCommandDescription())
// }
// }
// }
// else -> aapsLogger.warn(LTag.PUMP,"Unknown pump state: " + pumpStatus.pumpDeviceState)
// }
val status = commandQueue.spannedStatus()
if (status.toString() == "") {
omnipod_queue.visibility = View.GONE

View file

@ -1869,6 +1869,10 @@
<string name="omnipod_pod_active_alerts">Active Pod Alerts</string>
<string name="omnipod_ack_short">Ack Alerts</string>
<string name="omnipod_last_bolus" translatable="false">%1$.2f %2$s (%3$s)</string>
<string name="omnipod_pod_status_initalizing">Initializing</string>
<string name="omnipod_pod_status_active">Active</string>
<string name="omnipod_pod_status_unknown">Unknown</string>
<!-- Omnipod - Dialogs -->
<string name="omnipod_frequency">Omnipod (433.91 MHz)</string>