- changes to make driver running (no init pod yet), just fixed some running pains with driver
This commit is contained in:
parent
9b0a4b742d
commit
4351b65a92
12 changed files with 211 additions and 101 deletions
|
@ -27,7 +27,7 @@ public abstract class PumpStatus {
|
||||||
|
|
||||||
// other pump settings
|
// other pump settings
|
||||||
public String activeProfileName = "0";
|
public String activeProfileName = "0";
|
||||||
public double reservoirRemainingUnits = 0d;
|
public double reservoirRemainingUnits = 0.0d;
|
||||||
public int reservoirFullUnits = 0;
|
public int reservoirFullUnits = 0;
|
||||||
public int batteryRemaining = 0; // percent, so 0-100
|
public int batteryRemaining = 0; // percent, so 0-100
|
||||||
public Double batteryVoltage = null;
|
public Double batteryVoltage = null;
|
||||||
|
|
|
@ -13,6 +13,7 @@ import java.util.Locale;
|
||||||
|
|
||||||
import info.nightscout.androidaps.MainApp;
|
import info.nightscout.androidaps.MainApp;
|
||||||
import info.nightscout.androidaps.R;
|
import info.nightscout.androidaps.R;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.common.defs.PumpType;
|
||||||
import info.nightscout.androidaps.plugins.pump.common.dialog.RefreshableInterface;
|
import info.nightscout.androidaps.plugins.pump.common.dialog.RefreshableInterface;
|
||||||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil;
|
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil;
|
||||||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.defs.RileyLinkFirmwareVersion;
|
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.defs.RileyLinkFirmwareVersion;
|
||||||
|
@ -22,6 +23,8 @@ import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.Riley
|
||||||
import info.nightscout.androidaps.plugins.pump.common.utils.StringUtil;
|
import info.nightscout.androidaps.plugins.pump.common.utils.StringUtil;
|
||||||
import info.nightscout.androidaps.plugins.pump.medtronic.driver.MedtronicPumpStatus;
|
import info.nightscout.androidaps.plugins.pump.medtronic.driver.MedtronicPumpStatus;
|
||||||
import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil;
|
import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.service.OmnipodPumpStatus;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.util.OmnipodUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by andy on 5/19/18.
|
* Created by andy on 5/19/18.
|
||||||
|
@ -44,6 +47,7 @@ public class RileyLinkStatusGeneral extends Fragment implements RefreshableInter
|
||||||
RileyLinkServiceData rileyLinkServiceData;
|
RileyLinkServiceData rileyLinkServiceData;
|
||||||
|
|
||||||
MedtronicPumpStatus medtronicPumpStatus;
|
MedtronicPumpStatus medtronicPumpStatus;
|
||||||
|
OmnipodPumpStatus omnipodPumpStatus;
|
||||||
boolean first = false;
|
boolean first = false;
|
||||||
|
|
||||||
|
|
||||||
|
@ -118,7 +122,8 @@ public class RileyLinkStatusGeneral extends Fragment implements RefreshableInter
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO add handling for Omnipod pump status
|
if (MedtronicUtil.isMedtronicPump()) {
|
||||||
|
|
||||||
this.medtronicPumpStatus = MedtronicUtil.getPumpStatus();
|
this.medtronicPumpStatus = MedtronicUtil.getPumpStatus();
|
||||||
|
|
||||||
if (medtronicPumpStatus != null) {
|
if (medtronicPumpStatus != null) {
|
||||||
|
@ -127,8 +132,6 @@ public class RileyLinkStatusGeneral extends Fragment implements RefreshableInter
|
||||||
this.serialNumber.setText(medtronicPumpStatus.serialNumber);
|
this.serialNumber.setText(medtronicPumpStatus.serialNumber);
|
||||||
this.pumpFrequency.setText(MainApp.gs(medtronicPumpStatus.pumpFrequency.equals("medtronic_pump_frequency_us_ca") ? R.string.medtronic_pump_frequency_us_ca : R.string.medtronic_pump_frequency_worldwide));
|
this.pumpFrequency.setText(MainApp.gs(medtronicPumpStatus.pumpFrequency.equals("medtronic_pump_frequency_us_ca") ? R.string.medtronic_pump_frequency_us_ca : R.string.medtronic_pump_frequency_worldwide));
|
||||||
|
|
||||||
// TODO extend when Omnipod used
|
|
||||||
|
|
||||||
if (MedtronicUtil.getMedtronicPumpModel() != null)
|
if (MedtronicUtil.getMedtronicPumpModel() != null)
|
||||||
this.connectedDevice.setText("Medtronic " + MedtronicUtil.getMedtronicPumpModel().getPumpModel());
|
this.connectedDevice.setText("Medtronic " + MedtronicUtil.getMedtronicPumpModel().getPumpModel());
|
||||||
else
|
else
|
||||||
|
@ -142,7 +145,36 @@ public class RileyLinkStatusGeneral extends Fragment implements RefreshableInter
|
||||||
this.lastDeviceContact.setText(StringUtil.toDateTimeString(new LocalDateTime(
|
this.lastDeviceContact.setText(StringUtil.toDateTimeString(new LocalDateTime(
|
||||||
medtronicPumpStatus.lastDataTime)));
|
medtronicPumpStatus.lastDataTime)));
|
||||||
else
|
else
|
||||||
this.lastDeviceContact.setText("Never");
|
this.lastDeviceContact.setText(MainApp.gs(R.string.common_never));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
|
||||||
|
// TODO add handling for Omnipod Dash pump status
|
||||||
|
this.omnipodPumpStatus = OmnipodUtil.getPumpStatus();
|
||||||
|
|
||||||
|
if (omnipodPumpStatus != null) {
|
||||||
|
this.deviceType.setText(MainApp.gs(RileyLinkTargetDevice.Omnipod.getResourceId()));
|
||||||
|
this.deviceModel.setText(omnipodPumpStatus.pumpType== PumpType.Insulet_Omnipod ? "Eros" : "Dash");
|
||||||
|
this.pumpFrequency.setText(MainApp.gs(R.string.omnipod_frequency));
|
||||||
|
|
||||||
|
if (omnipodPumpStatus.podAvailable) {
|
||||||
|
this.serialNumber.setText(omnipodPumpStatus.podNumber);
|
||||||
|
this.connectedDevice.setText(omnipodPumpStatus.pumpType== PumpType.Insulet_Omnipod ? "Eros Pod" : "Dash Pod");
|
||||||
|
} else {
|
||||||
|
this.connectedDevice.setText("-");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (rileyLinkServiceData.lastGoodFrequency != null)
|
||||||
|
this.lastUsedFrequency.setText(String.format(Locale.ENGLISH, "%.2f MHz",
|
||||||
|
rileyLinkServiceData.lastGoodFrequency));
|
||||||
|
|
||||||
|
if (omnipodPumpStatus.lastConnection != 0)
|
||||||
|
this.lastDeviceContact.setText(StringUtil.toDateTimeString(new LocalDateTime(
|
||||||
|
omnipodPumpStatus.lastDataTime)));
|
||||||
|
else
|
||||||
|
this.lastDeviceContact.setText(MainApp.gs(R.string.common_never));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,11 +8,13 @@ import org.slf4j.LoggerFactory;
|
||||||
import info.nightscout.androidaps.logging.L;
|
import info.nightscout.androidaps.logging.L;
|
||||||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkConst;
|
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkConst;
|
||||||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil;
|
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.defs.RileyLinkTargetFrequency;
|
||||||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkError;
|
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkError;
|
||||||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkServiceState;
|
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkServiceState;
|
||||||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkTargetDevice;
|
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkTargetDevice;
|
||||||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.data.ServiceTransport;
|
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.data.ServiceTransport;
|
||||||
import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicConst;
|
import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicConst;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil;
|
||||||
import info.nightscout.androidaps.utils.SP;
|
import info.nightscout.androidaps.utils.SP;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -56,6 +58,9 @@ public class InitializePumpManagerTask extends ServiceTask {
|
||||||
lastGoodFrequency = RileyLinkUtil.getRileyLinkServiceData().lastGoodFrequency;
|
lastGoodFrequency = RileyLinkUtil.getRileyLinkServiceData().lastGoodFrequency;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (MedtronicUtil.isMedtronicPump()) {
|
||||||
|
|
||||||
if ((lastGoodFrequency > 0.0d)
|
if ((lastGoodFrequency > 0.0d)
|
||||||
&& RileyLinkUtil.getRileyLinkCommunicationManager().isValidFrequency(lastGoodFrequency)) {
|
&& RileyLinkUtil.getRileyLinkCommunicationManager().isValidFrequency(lastGoodFrequency)) {
|
||||||
|
|
||||||
|
@ -79,5 +84,29 @@ public class InitializePumpManagerTask extends ServiceTask {
|
||||||
} else {
|
} else {
|
||||||
RileyLinkUtil.sendBroadcastMessage(RileyLinkConst.IPC.MSG_PUMP_tunePump);
|
RileyLinkUtil.sendBroadcastMessage(RileyLinkConst.IPC.MSG_PUMP_tunePump);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
|
||||||
|
if (!RileyLinkUtil.isSame(lastGoodFrequency, RileyLinkTargetFrequency.Omnipod.getScanFrequencies()[0])) {
|
||||||
|
lastGoodFrequency = RileyLinkTargetFrequency.Omnipod.getScanFrequencies()[0];
|
||||||
|
lastGoodFrequency = Math.round(lastGoodFrequency * 1000d) / 1000d;
|
||||||
|
|
||||||
|
RileyLinkUtil.getRileyLinkServiceData().lastGoodFrequency = lastGoodFrequency;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
RileyLinkUtil.setServiceState(RileyLinkServiceState.RileyLinkReady);
|
||||||
|
RileyLinkUtil.setRileyLinkTargetFrequency(RileyLinkTargetFrequency.Omnipod);
|
||||||
|
|
||||||
|
if (L.isEnabled(L.PUMPCOMM))
|
||||||
|
LOG.info("Setting radio frequency to {} MHz", lastGoodFrequency);
|
||||||
|
|
||||||
|
RileyLinkUtil.getRileyLinkCommunicationManager().setRadioFrequencyForPump(lastGoodFrequency);
|
||||||
|
|
||||||
|
|
||||||
|
LOG.error("TRYYYYYY TO CONNECT IF AVAILABLE");
|
||||||
|
|
||||||
|
RileyLinkUtil.setServiceState(RileyLinkServiceState.PumpConnectorReady);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,6 +46,7 @@ import org.slf4j.LoggerFactory
|
||||||
class OmnipodFragment : Fragment() {
|
class OmnipodFragment : Fragment() {
|
||||||
private val log = LoggerFactory.getLogger(L.PUMP)
|
private val log = LoggerFactory.getLogger(L.PUMP)
|
||||||
private var disposable: CompositeDisposable = CompositeDisposable()
|
private var disposable: CompositeDisposable = CompositeDisposable()
|
||||||
|
private var podAvailable = false
|
||||||
|
|
||||||
operator fun CompositeDisposable.plusAssign(disposable: Disposable) {
|
operator fun CompositeDisposable.plusAssign(disposable: Disposable) {
|
||||||
add(disposable)
|
add(disposable)
|
||||||
|
@ -68,7 +69,7 @@ class OmnipodFragment : Fragment() {
|
||||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
super.onViewCreated(view, savedInstanceState)
|
super.onViewCreated(view, savedInstanceState)
|
||||||
|
|
||||||
omnipod_pod_status.setBackgroundColor(MainApp.gc(R.color.colorInitializingBorder))
|
//omnipod_pod_status.setBackgroundColor(MainApp.gc(R.color.colorInitializingBorder))
|
||||||
|
|
||||||
omnipod_rl_status.text = MainApp.gs(RileyLinkServiceState.NotStarted.getResourceId(RileyLinkTargetDevice.Omnipod))
|
omnipod_rl_status.text = MainApp.gs(RileyLinkServiceState.NotStarted.getResourceId(RileyLinkTargetDevice.Omnipod))
|
||||||
|
|
||||||
|
@ -199,9 +200,11 @@ class OmnipodFragment : Fragment() {
|
||||||
if (pumpStatus.podSessionState == null) {
|
if (pumpStatus.podSessionState == null) {
|
||||||
omnipod_pod_address.text = MainApp.gs(R.string.omnipod_pod_name_no_info)
|
omnipod_pod_address.text = MainApp.gs(R.string.omnipod_pod_name_no_info)
|
||||||
omnipod_pod_expiry.text = "-"
|
omnipod_pod_expiry.text = "-"
|
||||||
omnipod_pod_status.text = "{fa-bed} "
|
omnipod_pod_status.text = MainApp.gs(R.string.omnipod_pod_no_pod_connected)
|
||||||
|
pumpStatus.podAvailable = false
|
||||||
} else {
|
} else {
|
||||||
|
podAvailable = true
|
||||||
|
pumpStatus.podAvailable = true
|
||||||
omnipod_pod_address.text = pumpStatus.podSessionState.address.toString()
|
omnipod_pod_address.text = pumpStatus.podSessionState.address.toString()
|
||||||
omnipod_pod_expiry.text = pumpStatus.podSessionState.expiryDateAsString
|
omnipod_pod_expiry.text = pumpStatus.podSessionState.expiryDateAsString
|
||||||
|
|
||||||
|
@ -307,6 +310,7 @@ class OmnipodFragment : Fragment() {
|
||||||
|
|
||||||
setDeviceStatus()
|
setDeviceStatus()
|
||||||
|
|
||||||
|
if (podAvailable) {
|
||||||
// last connection
|
// last connection
|
||||||
if (pumpStatus.lastConnection != 0L) {
|
if (pumpStatus.lastConnection != 0L) {
|
||||||
val minAgo = DateUtil.minAgo(pumpStatus.lastConnection)
|
val minAgo = DateUtil.minAgo(pumpStatus.lastConnection)
|
||||||
|
@ -339,7 +343,7 @@ class OmnipodFragment : Fragment() {
|
||||||
// last bolus
|
// last bolus
|
||||||
val bolus = pumpStatus.lastBolusAmount
|
val bolus = pumpStatus.lastBolusAmount
|
||||||
val bolusTime = pumpStatus.lastBolusTime
|
val bolusTime = pumpStatus.lastBolusTime
|
||||||
if (bolus != null && bolusTime != null) {
|
if (bolus != null && bolusTime != null && podAvailable) {
|
||||||
val agoMsc = System.currentTimeMillis() - pumpStatus.lastBolusTime.time
|
val agoMsc = System.currentTimeMillis() - pumpStatus.lastBolusTime.time
|
||||||
val bolusMinAgo = agoMsc.toDouble() / 60.0 / 1000.0
|
val bolusMinAgo = agoMsc.toDouble() / 60.0 / 1000.0
|
||||||
val unit = MainApp.gs(R.string.insulin_unit_shortname)
|
val unit = MainApp.gs(R.string.insulin_unit_shortname)
|
||||||
|
@ -357,20 +361,35 @@ class OmnipodFragment : Fragment() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// base basal rate
|
// base basal rate
|
||||||
omnipod_basabasalrate.text = ("(" + pumpStatus.activeProfileName + ") "
|
|
||||||
+ MainApp.gs(R.string.pump_basebasalrate, plugin.baseBasalRate))
|
omnipod_basabasalrate.text = MainApp.gs(R.string.pump_basebasalrate, plugin.baseBasalRate)
|
||||||
|
|
||||||
omnipod_tempbasal.text = TreatmentsPlugin.getPlugin()
|
omnipod_tempbasal.text = TreatmentsPlugin.getPlugin()
|
||||||
.getTempBasalFromHistory(System.currentTimeMillis())?.toStringFull() ?: ""
|
.getTempBasalFromHistory(System.currentTimeMillis())?.toStringFull() ?: ""
|
||||||
|
|
||||||
// reservoir
|
// reservoir
|
||||||
if (RileyLinkUtil.isSame(pumpStatus.reservoirRemainingUnits, 0.0)) {
|
if (RileyLinkUtil.isSame(pumpStatus.reservoirRemainingUnits, 75.0)) {
|
||||||
omnipod_reservoir.text = MainApp.gs(R.string.omnipod_reservoir_over50)
|
omnipod_reservoir.text = MainApp.gs(R.string.omnipod_reservoir_over50)
|
||||||
} else {
|
} else {
|
||||||
omnipod_reservoir.text = MainApp.gs(R.string.omnipod_reservoir_left, pumpStatus.reservoirRemainingUnits)
|
omnipod_reservoir.text = MainApp.gs(R.string.omnipod_reservoir_left, pumpStatus.reservoirRemainingUnits)
|
||||||
}
|
}
|
||||||
SetWarnColor.setColorInverse(omnipod_reservoir, pumpStatus.reservoirRemainingUnits, 50.0, 20.0)
|
SetWarnColor.setColorInverse(omnipod_reservoir, pumpStatus.reservoirRemainingUnits, 50.0, 20.0)
|
||||||
|
|
||||||
|
} else {
|
||||||
|
omnipod_basabasalrate.text = ""
|
||||||
|
omnipod_reservoir.text = ""
|
||||||
|
omnipod_tempbasal.text = ""
|
||||||
|
omnipod_lastbolus.text = ""
|
||||||
|
omnipod_lastconnection.text = ""
|
||||||
|
omnipod_lastconnection.setTextColor(Color.WHITE)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
omnipod_errors.text = pumpStatus.errorInfo
|
omnipod_errors.text = pumpStatus.errorInfo
|
||||||
|
|
||||||
|
omnipod_pod_active_alerts_ack.isEnabled = pumpStatus.ackAlertsAvailable
|
||||||
|
|
||||||
|
omnipod_refresh.isEnabled = pumpStatus.podAvailable
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.comm.action.DeactivatePod
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.comm.action.GetPodInfoAction;
|
import info.nightscout.androidaps.plugins.pump.omnipod.comm.action.GetPodInfoAction;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.comm.action.GetStatusAction;
|
import info.nightscout.androidaps.plugins.pump.omnipod.comm.action.GetStatusAction;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.comm.action.InsertCannulaAction;
|
import info.nightscout.androidaps.plugins.pump.omnipod.comm.action.InsertCannulaAction;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.comm.action.OmnipodAction;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.comm.action.PairAction;
|
import info.nightscout.androidaps.plugins.pump.omnipod.comm.action.PairAction;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.comm.action.PrimeAction;
|
import info.nightscout.androidaps.plugins.pump.omnipod.comm.action.PrimeAction;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.comm.action.SetBasalScheduleAction;
|
import info.nightscout.androidaps.plugins.pump.omnipod.comm.action.SetBasalScheduleAction;
|
||||||
|
@ -345,4 +346,9 @@ public class OmnipodManager {
|
||||||
// TODO use string resource
|
// TODO use string resource
|
||||||
return new PumpEnactResult().success(false).enacted(false).comment("Pod should be initialized first");
|
return new PumpEnactResult().success(false).enacted(false).comment("Pod should be initialized first");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void addToHistory(long requestTime, OmnipodAction omnipodAction, long responseTime) {
|
||||||
|
// TODO andy
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -113,10 +113,10 @@ public class OmnipodPumpPlugin extends PumpPluginAbstract implements OmnipodPump
|
||||||
OmnipodUtil.setOmnipodPodType(OmnipodPodType.Eros);
|
OmnipodUtil.setOmnipodPodType(OmnipodPodType.Eros);
|
||||||
|
|
||||||
if (omnipodCommunicationManager == null) {
|
if (omnipodCommunicationManager == null) {
|
||||||
omnipodCommunicationManager = AapsOmnipodManager.getInstance();
|
//omnipodCommunicationManager = AapsOmnipodManager.getInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
omnipodUIComm = new OmnipodUIComm(omnipodCommunicationManager);
|
omnipodUIComm = new OmnipodUIComm(omnipodCommunicationManager, this, this.pumpStatusLocal);
|
||||||
|
|
||||||
OmnipodUtil.setPlugin(this);
|
OmnipodUtil.setPlugin(this);
|
||||||
|
|
||||||
|
@ -255,7 +255,7 @@ public class OmnipodPumpPlugin extends PumpPluginAbstract implements OmnipodPump
|
||||||
|
|
||||||
if (isServiceSet()) {
|
if (isServiceSet()) {
|
||||||
|
|
||||||
if (isBusy)
|
if (isBusy || !pumpStatusLocal.podAvailable)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (busyTimestamps.size() > 0) {
|
if (busyTimestamps.size() > 0) {
|
||||||
|
@ -313,6 +313,11 @@ public class OmnipodPumpPlugin extends PumpPluginAbstract implements OmnipodPump
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isSuspended() {
|
||||||
|
return (pumpStatusLocal!=null && !pumpStatusLocal.podAvailable);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void getPumpStatus() {
|
public void getPumpStatus() {
|
||||||
|
|
||||||
|
@ -487,6 +492,12 @@ public class OmnipodPumpPlugin extends PumpPluginAbstract implements OmnipodPump
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isFakingTempsByExtendedBoluses() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@NonNull
|
@NonNull
|
||||||
protected PumpEnactResult deliverBolus(final DetailedBolusInfo detailedBolusInfo) {
|
protected PumpEnactResult deliverBolus(final DetailedBolusInfo detailedBolusInfo) {
|
||||||
|
|
|
@ -4,8 +4,10 @@ import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import info.nightscout.androidaps.logging.L;
|
import info.nightscout.androidaps.logging.L;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.OmnipodPumpPlugin;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.defs.OmnipodCommunicationManagerInterface;
|
import info.nightscout.androidaps.plugins.pump.omnipod.defs.OmnipodCommunicationManagerInterface;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.defs.OmnipodCommandType;
|
import info.nightscout.androidaps.plugins.pump.omnipod.defs.OmnipodCommandType;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.service.OmnipodPumpStatus;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.util.OmnipodUtil;
|
import info.nightscout.androidaps.plugins.pump.omnipod.util.OmnipodUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -16,15 +18,16 @@ public class OmnipodUIComm {
|
||||||
private static final Logger LOG = LoggerFactory.getLogger(L.PUMP);
|
private static final Logger LOG = LoggerFactory.getLogger(L.PUMP);
|
||||||
|
|
||||||
OmnipodCommunicationManagerInterface ocmInstance = null;
|
OmnipodCommunicationManagerInterface ocmInstance = null;
|
||||||
OmnipodUIPostprocessor uiPostprocessor = new OmnipodUIPostprocessor();
|
OmnipodUIPostprocessor uiPostprocessor; // = new OmnipodUIPostprocessor();
|
||||||
|
|
||||||
|
|
||||||
private OmnipodCommunicationManagerInterface getCommunicationManager() {
|
private OmnipodCommunicationManagerInterface getCommunicationManager() {
|
||||||
return ocmInstance;
|
return ocmInstance;
|
||||||
}
|
}
|
||||||
|
|
||||||
public OmnipodUIComm(OmnipodCommunicationManagerInterface communicationManager) {
|
public OmnipodUIComm(OmnipodCommunicationManagerInterface communicationManager, OmnipodPumpPlugin plugin, OmnipodPumpStatus status) {
|
||||||
ocmInstance = communicationManager;
|
ocmInstance = communicationManager;
|
||||||
|
uiPostprocessor = new OmnipodUIPostprocessor(plugin, status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -21,9 +21,11 @@ public class OmnipodUIPostprocessor {
|
||||||
OmnipodPumpPlugin omnipodPumpPlugin;
|
OmnipodPumpPlugin omnipodPumpPlugin;
|
||||||
|
|
||||||
|
|
||||||
public OmnipodUIPostprocessor() {
|
public OmnipodUIPostprocessor(OmnipodPumpPlugin plugin, OmnipodPumpStatus pumpStatus) {
|
||||||
pumpStatus = OmnipodUtil.getPumpStatus();
|
// pumpStatus = OmnipodUtil.getPumpStatus();
|
||||||
omnipodPumpPlugin = OmnipodPumpPlugin.getPlugin();
|
// omnipodPumpPlugin = OmnipodPumpPlugin.getPlugin();
|
||||||
|
this.pumpStatus = pumpStatus;
|
||||||
|
this.omnipodPumpPlugin = plugin;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -48,6 +48,8 @@ public class OmnipodPumpStatus extends PumpStatus {
|
||||||
|
|
||||||
public String podNumber;
|
public String podNumber;
|
||||||
public PodDeviceState podDeviceState = PodDeviceState.NeverContacted;
|
public PodDeviceState podDeviceState = PodDeviceState.NeverContacted;
|
||||||
|
public boolean podAvailable = false;
|
||||||
|
public boolean ackAlertsAvailable = false;
|
||||||
|
|
||||||
|
|
||||||
public OmnipodPumpStatus(PumpDescription pumpDescription) {
|
public OmnipodPumpStatus(PumpDescription pumpDescription) {
|
||||||
|
@ -63,6 +65,7 @@ public class OmnipodPumpStatus extends PumpStatus {
|
||||||
this.lastConnection = SP.getLong(OmnipodConst.Statistics.LastGoodPumpCommunicationTime, 0L);
|
this.lastConnection = SP.getLong(OmnipodConst.Statistics.LastGoodPumpCommunicationTime, 0L);
|
||||||
this.lastDataTime = new LocalDateTime(this.lastConnection);
|
this.lastDataTime = new LocalDateTime(this.lastConnection);
|
||||||
this.pumpType = PumpType.Insulet_Omnipod;
|
this.pumpType = PumpType.Insulet_Omnipod;
|
||||||
|
this.podAvailable = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -61,7 +61,6 @@ public class OmnipodDashPumpPlugin extends OmnipodPumpPlugin implements OmnipodP
|
||||||
|
|
||||||
|
|
||||||
private OmnipodDashPumpPlugin() {
|
private OmnipodDashPumpPlugin() {
|
||||||
|
|
||||||
super(new PluginDescription() //
|
super(new PluginDescription() //
|
||||||
.mainType(PluginType.PUMP) //
|
.mainType(PluginType.PUMP) //
|
||||||
.fragmentClass(OmnipodFragment.class.getName()) //
|
.fragmentClass(OmnipodFragment.class.getName()) //
|
||||||
|
@ -80,7 +79,7 @@ public class OmnipodDashPumpPlugin extends OmnipodPumpPlugin implements OmnipodP
|
||||||
omnipodCommunicationManager = OmnipodDashCommunicationManager.getInstance();
|
omnipodCommunicationManager = OmnipodDashCommunicationManager.getInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
omnipodUIComm = new OmnipodUIComm(omnipodCommunicationManager);
|
omnipodUIComm = new OmnipodUIComm(omnipodCommunicationManager, this, this.pumpStatusLocal);
|
||||||
|
|
||||||
OmnipodUtil.setPlugin(this);
|
OmnipodUtil.setPlugin(this);
|
||||||
|
|
||||||
|
|
|
@ -206,8 +206,9 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:gravity="start"
|
android:gravity="start"
|
||||||
android:paddingLeft="5dp"
|
android:paddingStart="5dp"
|
||||||
android:text="{fa-bluetooth-b}"
|
android:paddingEnd="5dp"
|
||||||
|
android:text=""
|
||||||
android:textColor="@android:color/white"
|
android:textColor="@android:color/white"
|
||||||
android:textSize="14sp" />
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
|
|
@ -1470,6 +1470,7 @@
|
||||||
<string name="rileylink_scanner_scanning">Scanning</string>
|
<string name="rileylink_scanner_scanning">Scanning</string>
|
||||||
<string name="rileylink_scanner_scanning_finished">Scanning finished</string>
|
<string name="rileylink_scanner_scanning_finished">Scanning finished</string>
|
||||||
<string name="rileylink_scanner_scanning_error">Scanning error: %1$d</string>
|
<string name="rileylink_scanner_scanning_error">Scanning error: %1$d</string>
|
||||||
|
<string name="common_never">Never</string>
|
||||||
|
|
||||||
|
|
||||||
<!-- RL Status Page -->
|
<!-- RL Status Page -->
|
||||||
|
@ -1631,9 +1632,13 @@
|
||||||
<string name="omnipod_pod_address">Pod Address</string>
|
<string name="omnipod_pod_address">Pod Address</string>
|
||||||
<string name="omnipod_pod_expiry">Pod Expires</string>
|
<string name="omnipod_pod_expiry">Pod Expires</string>
|
||||||
<string name="omnipod_pod_name_no_info">No info</string>
|
<string name="omnipod_pod_name_no_info">No info</string>
|
||||||
|
<string name="omnipod_pod_no_pod_connected">No Pod connected</string>
|
||||||
<string name="omnipod_pod_active_alerts">Active Pod Alerts</string>
|
<string name="omnipod_pod_active_alerts">Active Pod Alerts</string>
|
||||||
<string name="omnipod_ack_short">Ack Alerts</string>
|
<string name="omnipod_ack_short">Ack Alerts</string>
|
||||||
|
|
||||||
|
<!-- Omnipod - Dialogs -->
|
||||||
|
<string name="omnipod_frequency">Omnipod (433.91 MHz)</string>
|
||||||
|
|
||||||
|
|
||||||
<!-- Omnipod - Error -->
|
<!-- Omnipod - Error -->
|
||||||
<string name="omnipod_error_operation_not_possible_no_configuration">Operation is not possible.\n\n You need to configure Omnipod first, before you can use this operation.</string>
|
<string name="omnipod_error_operation_not_possible_no_configuration">Operation is not possible.\n\n You need to configure Omnipod first, before you can use this operation.</string>
|
||||||
|
|
Loading…
Reference in a new issue