- removed some old code
- added PodHistory (doesn't work 100% yet)
This commit is contained in:
parent
b5b68f6cda
commit
bb1ffadc58
6 changed files with 163 additions and 122 deletions
|
@ -51,11 +51,13 @@ import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin;
|
||||||
import info.nightscout.androidaps.plugins.general.nsclient.NSUpload;
|
import info.nightscout.androidaps.plugins.general.nsclient.NSUpload;
|
||||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin;
|
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin;
|
||||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventNewHistoryData;
|
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventNewHistoryData;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.combo.ruffyscripter.history.PumpHistory;
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.activities.DanaRNSHistorySync;
|
import info.nightscout.androidaps.plugins.pump.danaR.activities.DanaRNSHistorySync;
|
||||||
import info.nightscout.androidaps.plugins.pump.danaR.comm.RecordTypes;
|
import info.nightscout.androidaps.plugins.pump.danaR.comm.RecordTypes;
|
||||||
import info.nightscout.androidaps.plugins.pump.insight.database.InsightBolusID;
|
import info.nightscout.androidaps.plugins.pump.insight.database.InsightBolusID;
|
||||||
import info.nightscout.androidaps.plugins.pump.insight.database.InsightHistoryOffset;
|
import info.nightscout.androidaps.plugins.pump.insight.database.InsightHistoryOffset;
|
||||||
import info.nightscout.androidaps.plugins.pump.insight.database.InsightPumpID;
|
import info.nightscout.androidaps.plugins.pump.insight.database.InsightPumpID;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.db.PodHistory;
|
||||||
import info.nightscout.androidaps.plugins.pump.virtual.VirtualPumpPlugin;
|
import info.nightscout.androidaps.plugins.pump.virtual.VirtualPumpPlugin;
|
||||||
import info.nightscout.androidaps.utils.JsonHelper;
|
import info.nightscout.androidaps.utils.JsonHelper;
|
||||||
import info.nightscout.androidaps.utils.PercentageSplitter;
|
import info.nightscout.androidaps.utils.PercentageSplitter;
|
||||||
|
@ -85,8 +87,9 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper {
|
||||||
public static final String DATABASE_INSIGHT_HISTORY_OFFSETS = "InsightHistoryOffsets";
|
public static final String DATABASE_INSIGHT_HISTORY_OFFSETS = "InsightHistoryOffsets";
|
||||||
public static final String DATABASE_INSIGHT_BOLUS_IDS = "InsightBolusIDs";
|
public static final String DATABASE_INSIGHT_BOLUS_IDS = "InsightBolusIDs";
|
||||||
public static final String DATABASE_INSIGHT_PUMP_IDS = "InsightPumpIDs";
|
public static final String DATABASE_INSIGHT_PUMP_IDS = "InsightPumpIDs";
|
||||||
|
public static final String DATABASE_POD_HISTORY = "PodHistory";
|
||||||
|
|
||||||
private static final int DATABASE_VERSION = 11;
|
private static final int DATABASE_VERSION = 12;
|
||||||
|
|
||||||
public static Long earliestDataChange = null;
|
public static Long earliestDataChange = null;
|
||||||
|
|
||||||
|
@ -134,6 +137,7 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper {
|
||||||
TableUtils.createTableIfNotExists(connectionSource, InsightHistoryOffset.class);
|
TableUtils.createTableIfNotExists(connectionSource, InsightHistoryOffset.class);
|
||||||
TableUtils.createTableIfNotExists(connectionSource, InsightBolusID.class);
|
TableUtils.createTableIfNotExists(connectionSource, InsightBolusID.class);
|
||||||
TableUtils.createTableIfNotExists(connectionSource, InsightPumpID.class);
|
TableUtils.createTableIfNotExists(connectionSource, InsightPumpID.class);
|
||||||
|
TableUtils.createTableIfNotExists(connectionSource, PodHistory.class);
|
||||||
database.execSQL("INSERT INTO sqlite_sequence (name, seq) SELECT \"" + DATABASE_INSIGHT_BOLUS_IDS + "\", " + System.currentTimeMillis() + " " +
|
database.execSQL("INSERT INTO sqlite_sequence (name, seq) SELECT \"" + DATABASE_INSIGHT_BOLUS_IDS + "\", " + System.currentTimeMillis() + " " +
|
||||||
"WHERE NOT EXISTS (SELECT 1 FROM sqlite_sequence WHERE name = \"" + DATABASE_INSIGHT_BOLUS_IDS + "\")");
|
"WHERE NOT EXISTS (SELECT 1 FROM sqlite_sequence WHERE name = \"" + DATABASE_INSIGHT_BOLUS_IDS + "\")");
|
||||||
database.execSQL("INSERT INTO sqlite_sequence (name, seq) SELECT \"" + DATABASE_INSIGHT_PUMP_IDS + "\", " + System.currentTimeMillis() + " " +
|
database.execSQL("INSERT INTO sqlite_sequence (name, seq) SELECT \"" + DATABASE_INSIGHT_PUMP_IDS + "\", " + System.currentTimeMillis() + " " +
|
||||||
|
@ -219,6 +223,7 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper {
|
||||||
TableUtils.dropTable(connectionSource, CareportalEvent.class, true);
|
TableUtils.dropTable(connectionSource, CareportalEvent.class, true);
|
||||||
TableUtils.dropTable(connectionSource, ProfileSwitch.class, true);
|
TableUtils.dropTable(connectionSource, ProfileSwitch.class, true);
|
||||||
TableUtils.dropTable(connectionSource, TDD.class, true);
|
TableUtils.dropTable(connectionSource, TDD.class, true);
|
||||||
|
TableUtils.dropTable(connectionSource, PodHistory.class, true);
|
||||||
TableUtils.createTableIfNotExists(connectionSource, TempTarget.class);
|
TableUtils.createTableIfNotExists(connectionSource, TempTarget.class);
|
||||||
TableUtils.createTableIfNotExists(connectionSource, BgReading.class);
|
TableUtils.createTableIfNotExists(connectionSource, BgReading.class);
|
||||||
TableUtils.createTableIfNotExists(connectionSource, DanaRHistoryRecord.class);
|
TableUtils.createTableIfNotExists(connectionSource, DanaRHistoryRecord.class);
|
||||||
|
@ -228,6 +233,7 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper {
|
||||||
TableUtils.createTableIfNotExists(connectionSource, CareportalEvent.class);
|
TableUtils.createTableIfNotExists(connectionSource, CareportalEvent.class);
|
||||||
TableUtils.createTableIfNotExists(connectionSource, ProfileSwitch.class);
|
TableUtils.createTableIfNotExists(connectionSource, ProfileSwitch.class);
|
||||||
TableUtils.createTableIfNotExists(connectionSource, TDD.class);
|
TableUtils.createTableIfNotExists(connectionSource, TDD.class);
|
||||||
|
TableUtils.createTableIfNotExists(connectionSource, PodHistory.class);
|
||||||
updateEarliestDataChange(0);
|
updateEarliestDataChange(0);
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
log.error("Unhandled exception", e);
|
log.error("Unhandled exception", e);
|
||||||
|
@ -362,6 +368,10 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper {
|
||||||
return getDao(InsightHistoryOffset.class);
|
return getDao(InsightHistoryOffset.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Dao<PodHistory, String> getDaoPodHistory() throws SQLException {
|
||||||
|
return getDao(PodHistory.class);
|
||||||
|
}
|
||||||
|
|
||||||
public static long roundDateToSec(long date) {
|
public static long roundDateToSec(long date) {
|
||||||
long rounded = date - date % 1000;
|
long rounded = date - date % 1000;
|
||||||
if (rounded != date)
|
if (rounded != date)
|
||||||
|
@ -1890,4 +1900,16 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper {
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------------- Food handling ---------------
|
// ---------------- Food handling ---------------
|
||||||
|
|
||||||
|
// ---------------- PodHistory handling ---------------
|
||||||
|
|
||||||
|
public void createOrUpdate(PodHistory podHistory) {
|
||||||
|
try {
|
||||||
|
getDaoPodHistory().createOrUpdate(podHistory);
|
||||||
|
} catch (SQLException e) {
|
||||||
|
log.error("Unhandled exception", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -119,6 +119,14 @@ public class DateTimeUtil {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static long toATechDate(long timeInMillis) {
|
||||||
|
GregorianCalendar gc = new GregorianCalendar();
|
||||||
|
gc.setTimeInMillis(timeInMillis);
|
||||||
|
|
||||||
|
return toATechDate(gc);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public static boolean isSameDay(LocalDateTime ldt1, LocalDateTime ldt2) {
|
public static boolean isSameDay(LocalDateTime ldt1, LocalDateTime ldt2) {
|
||||||
|
|
||||||
return (ldt1.getYear() == ldt2.getYear() && //
|
return (ldt1.getYear() == ldt2.getYear() && //
|
||||||
|
|
|
@ -132,7 +132,7 @@ public class OmnipodPumpPlugin extends PumpPluginAbstract implements OmnipodPump
|
||||||
|
|
||||||
for (int i = 0; i < 20; i++) {
|
for (int i = 0; i < 20; i++) {
|
||||||
|
|
||||||
if (OmnipodUtil.getPumpStatus() != null) {
|
if (pumpStatusLocal != null) {
|
||||||
if (isLoggingEnabled())
|
if (isLoggingEnabled())
|
||||||
LOG.debug("Starting OmniPod-RileyLink service");
|
LOG.debug("Starting OmniPod-RileyLink service");
|
||||||
if (OmnipodUtil.getPumpStatus().setNotInPreInit()) {
|
if (OmnipodUtil.getPumpStatus().setNotInPreInit()) {
|
||||||
|
@ -528,8 +528,9 @@ public class OmnipodPumpPlugin extends PumpPluginAbstract implements OmnipodPump
|
||||||
: OmnipodConst.Statistics.StandardBoluses);
|
: OmnipodConst.Statistics.StandardBoluses);
|
||||||
|
|
||||||
// calculate time for bolus and set driver to busy for that time
|
// calculate time for bolus and set driver to busy for that time
|
||||||
|
|
||||||
// TODO fix this
|
// TODO fix this
|
||||||
int bolusTime = (int) (detailedBolusInfo.insulin * 42.0d);
|
int bolusTime = 1; //omnipodCommunicationManager.get;
|
||||||
long time = System.currentTimeMillis() + (bolusTime * 1000);
|
long time = System.currentTimeMillis() + (bolusTime * 1000);
|
||||||
|
|
||||||
this.busyTimestamps.add(time);
|
this.busyTimestamps.add(time);
|
||||||
|
@ -780,17 +781,17 @@ public class OmnipodPumpPlugin extends PumpPluginAbstract implements OmnipodPump
|
||||||
private CustomAction customActionResetRLConfig = new CustomAction(
|
private CustomAction customActionResetRLConfig = new CustomAction(
|
||||||
R.string.medtronic_custom_action_reset_rileylink, OmnipodCustomActionType.ResetRileyLinkConfiguration, true);
|
R.string.medtronic_custom_action_reset_rileylink, OmnipodCustomActionType.ResetRileyLinkConfiguration, true);
|
||||||
|
|
||||||
protected CustomAction customActionPairAndPrime = new CustomAction(
|
// protected CustomAction customActionPairAndPrime = new CustomAction(
|
||||||
R.string.omnipod_cmd_init_pod, OmnipodCustomActionType.PairAndPrime, true);
|
// R.string.omnipod_cmd_init_pod, OmnipodCustomActionType.PairAndPrime, true);
|
||||||
|
//
|
||||||
protected CustomAction customActionFillCanullaSetBasalProfile = new CustomAction(
|
// protected CustomAction customActionFillCanullaSetBasalProfile = new CustomAction(
|
||||||
R.string.omnipod_cmd_init_pod, OmnipodCustomActionType.FillCanulaSetBasalProfile, false);
|
// R.string.omnipod_cmd_init_pod, OmnipodCustomActionType.FillCanulaSetBasalProfile, false);
|
||||||
|
//
|
||||||
protected CustomAction customActionDeactivatePod = new CustomAction(
|
// protected CustomAction customActionDeactivatePod = new CustomAction(
|
||||||
R.string.omnipod_cmd_deactivate_pod, OmnipodCustomActionType.DeactivatePod, false);
|
// R.string.omnipod_cmd_deactivate_pod, OmnipodCustomActionType.DeactivatePod, false);
|
||||||
|
//
|
||||||
protected CustomAction customActionResetPod = new CustomAction(
|
// protected CustomAction customActionResetPod = new CustomAction(
|
||||||
R.string.omnipod_cmd_reset_pod, OmnipodCustomActionType.ResetPodStatus, true);
|
// R.string.omnipod_cmd_reset_pod, OmnipodCustomActionType.ResetPodStatus, true);
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -811,9 +812,6 @@ public class OmnipodPumpPlugin extends PumpPluginAbstract implements OmnipodPump
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
LogReceiver logReceiver = new LogReceiver();
|
|
||||||
|
|
||||||
// TODO we need to brainstorm how we want to do this -- Andy
|
|
||||||
@Override
|
@Override
|
||||||
public void executeCustomAction(CustomActionType customActionType) {
|
public void executeCustomAction(CustomActionType customActionType) {
|
||||||
|
|
||||||
|
@ -826,31 +824,6 @@ public class OmnipodPumpPlugin extends PumpPluginAbstract implements OmnipodPump
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PairAndPrime: {
|
|
||||||
omnipodUIComm.executeCommand(OmnipodCommandType.PairAndPrimePod, PodInitActionType.PairAndPrimeWizardStep, logReceiver);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case FillCanulaSetBasalProfile: {
|
|
||||||
if (this.currentProfile != null) {
|
|
||||||
omnipodUIComm.executeCommand(OmnipodCommandType.FillCanulaAndSetBasalProfile, PodInitActionType.FillCannulaSetBasalProfileWizardStep, logReceiver, this.currentProfile);
|
|
||||||
} else {
|
|
||||||
OKDialog.show(MainApp.instance().getApplicationContext(), MainApp.gs(R.string.combo_warning),
|
|
||||||
MainApp.gs(R.string.omnipod_error_operation_not_possible_no_profile), null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case DeactivatePod: {
|
|
||||||
omnipodUIComm.executeCommand(OmnipodCommandType.DeactivatePod);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case ResetPodStatus: {
|
|
||||||
omnipodUIComm.executeCommand(OmnipodCommandType.ResetPodStatus);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -864,34 +837,12 @@ public class OmnipodPumpPlugin extends PumpPluginAbstract implements OmnipodPump
|
||||||
// LOG.warn(getLogPrefix() + "Time, Date and/or TimeZone changed. ");
|
// LOG.warn(getLogPrefix() + "Time, Date and/or TimeZone changed. ");
|
||||||
//
|
//
|
||||||
// this.hasTimeDateOrTimeZoneChanged = true;
|
// this.hasTimeDateOrTimeZoneChanged = true;
|
||||||
|
|
||||||
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void setEnableCustomAction(OmnipodCustomActionType customAction, boolean isEnabled) {
|
public void setEnableCustomAction(OmnipodCustomActionType customAction, boolean isEnabled) {
|
||||||
|
|
||||||
switch (customAction) {
|
|
||||||
|
|
||||||
case PairAndPrime: {
|
|
||||||
this.customActionPairAndPrime.setEnabled(isEnabled);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case FillCanulaSetBasalProfile: {
|
|
||||||
this.customActionFillCanullaSetBasalProfile.setEnabled(isEnabled);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
|
|
||||||
case DeactivatePod: {
|
|
||||||
this.customActionDeactivatePod.setEnabled(isEnabled);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
refreshCustomActionsList();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package info.nightscout.androidaps.db;
|
package info.nightscout.androidaps.plugins.pump.omnipod.driver.db;
|
||||||
|
|
||||||
import com.j256.ormlite.field.DatabaseField;
|
import com.j256.ormlite.field.DatabaseField;
|
||||||
import com.j256.ormlite.table.DatabaseTable;
|
import com.j256.ormlite.table.DatabaseTable;
|
||||||
|
@ -6,54 +6,115 @@ import com.j256.ormlite.table.DatabaseTable;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import info.nightscout.androidaps.db.DatabaseHelper;
|
||||||
|
import info.nightscout.androidaps.db.DbObjectBase;
|
||||||
import info.nightscout.androidaps.logging.L;
|
import info.nightscout.androidaps.logging.L;
|
||||||
import info.nightscout.androidaps.plugins.pump.common.utils.DateTimeUtil;
|
import info.nightscout.androidaps.plugins.pump.common.utils.DateTimeUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by mike on 20.09.2017.
|
* Created by andy on 30.11.2019.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@DatabaseTable(tableName = DatabaseHelper.DATABASE_TDDS)
|
@DatabaseTable(tableName = DatabaseHelper.DATABASE_POD_HISTORY)
|
||||||
public class TDD {
|
public class PodHistory implements DbObjectBase {
|
||||||
|
|
||||||
private static Logger log = LoggerFactory.getLogger(L.DATABASE);
|
private static Logger log = LoggerFactory.getLogger(L.DATABASE);
|
||||||
|
|
||||||
@DatabaseField(id = true)
|
@DatabaseField(id = true)
|
||||||
public long date;
|
public long date;
|
||||||
|
|
||||||
@DatabaseField
|
private PodDbEntryType podDbEntryType;
|
||||||
public double bolus;
|
|
||||||
|
|
||||||
@DatabaseField
|
@DatabaseField
|
||||||
public double basal;
|
private long podEntryTypeCode;
|
||||||
|
|
||||||
@DatabaseField
|
@DatabaseField
|
||||||
public double total;
|
private String data;
|
||||||
|
|
||||||
|
@DatabaseField
|
||||||
|
private boolean success;
|
||||||
|
|
||||||
|
@DatabaseField
|
||||||
|
private long pumpId;
|
||||||
|
|
||||||
|
@DatabaseField
|
||||||
|
private Boolean successConfirmed;
|
||||||
|
|
||||||
|
|
||||||
public double getTotal(){
|
|
||||||
return (total > 0d) ? total:(bolus+basal);
|
public PodHistory(PodDbEntryType podDbEntryType) {
|
||||||
|
this.date = System.currentTimeMillis();
|
||||||
|
this.podDbEntryType = podDbEntryType;
|
||||||
|
generatePumpId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public TDD() { }
|
public PodHistory(long dateTimeInMillis, PodDbEntryType podDbEntryType) {
|
||||||
|
this.date = dateTimeInMillis;
|
||||||
public TDD(long date, double bolus, double basal, double total){
|
this.podDbEntryType = podDbEntryType;
|
||||||
this.date = date;
|
generatePumpId();
|
||||||
this.bolus = bolus;
|
|
||||||
this.basal = basal;
|
|
||||||
this.total = total;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public long getDate() {
|
||||||
return "TDD [" +
|
return this.date;
|
||||||
"date=" + date +
|
|
||||||
"date(str)=" + DateTimeUtil.toStringFromTimeInMillis(date) +
|
|
||||||
", bolus=" + bolus +
|
|
||||||
", basal=" + basal +
|
|
||||||
", total=" + total +
|
|
||||||
']';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setDate(long date) {
|
||||||
|
this.date = date;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PodDbEntryType getPodDbEntryType() {
|
||||||
|
return podDbEntryType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPodDbEntryType(PodDbEntryType podDbEntryType) {
|
||||||
|
this.podDbEntryType = podDbEntryType;
|
||||||
|
this.podEntryTypeCode = podDbEntryType.getCode();
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getPodEntryTypeCode() {
|
||||||
|
return podEntryTypeCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getData() {
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setData(String data) {
|
||||||
|
this.data = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isSuccess() {
|
||||||
|
return success;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSuccess(boolean success) {
|
||||||
|
this.success = success;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPumpId(long pumpId) {
|
||||||
|
this.pumpId = pumpId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getSuccessConfirmed() {
|
||||||
|
return successConfirmed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSuccessConfirmed(Boolean successConfirmed) {
|
||||||
|
this.successConfirmed = successConfirmed;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long getPumpId() {
|
||||||
|
return pumpId;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void generatePumpId() {
|
||||||
|
this.pumpId = (DateTimeUtil.toATechDate(this.date) * 100L) + podEntryTypeCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,13 +16,11 @@ public class OmnipodUIPostprocessor {
|
||||||
|
|
||||||
private static final Logger LOG = LoggerFactory.getLogger(L.PUMP);
|
private static final Logger LOG = LoggerFactory.getLogger(L.PUMP);
|
||||||
|
|
||||||
OmnipodPumpStatus pumpStatus;
|
private OmnipodPumpStatus pumpStatus;
|
||||||
OmnipodPumpPlugin omnipodPumpPlugin;
|
private OmnipodPumpPlugin omnipodPumpPlugin;
|
||||||
|
|
||||||
|
|
||||||
public OmnipodUIPostprocessor(OmnipodPumpPlugin plugin, OmnipodPumpStatus pumpStatus) {
|
public OmnipodUIPostprocessor(OmnipodPumpPlugin plugin, OmnipodPumpStatus pumpStatus) {
|
||||||
// pumpStatus = OmnipodUtil.getPumpStatus();
|
|
||||||
// omnipodPumpPlugin = OmnipodPumpPlugin.getPlugin();
|
|
||||||
this.pumpStatus = pumpStatus;
|
this.pumpStatus = pumpStatus;
|
||||||
this.omnipodPumpPlugin = plugin;
|
this.omnipodPumpPlugin = plugin;
|
||||||
}
|
}
|
||||||
|
@ -34,29 +32,29 @@ public class OmnipodUIPostprocessor {
|
||||||
|
|
||||||
switch (uiTask.commandType) {
|
switch (uiTask.commandType) {
|
||||||
|
|
||||||
case PairAndPrimePod: {
|
// case PairAndPrimePod: {
|
||||||
if (uiTask.returnData.success) {
|
// if (uiTask.returnData.success) {
|
||||||
omnipodPumpPlugin.setEnableCustomAction(OmnipodCustomActionType.PairAndPrime, false);
|
// omnipodPumpPlugin.setEnableCustomAction(OmnipodCustomActionType.PairAndPrime, false);
|
||||||
omnipodPumpPlugin.setEnableCustomAction(OmnipodCustomActionType.FillCanulaSetBasalProfile, true);
|
// omnipodPumpPlugin.setEnableCustomAction(OmnipodCustomActionType.FillCanulaSetBasalProfile, true);
|
||||||
}
|
// }
|
||||||
omnipodPumpPlugin.setEnableCustomAction(OmnipodCustomActionType.DeactivatePod, true);
|
// omnipodPumpPlugin.setEnableCustomAction(OmnipodCustomActionType.DeactivatePod, true);
|
||||||
}
|
// }
|
||||||
break;
|
// break;
|
||||||
|
//
|
||||||
case FillCanulaAndSetBasalProfile: {
|
// case FillCanulaAndSetBasalProfile: {
|
||||||
if (uiTask.returnData.success) {
|
// if (uiTask.returnData.success) {
|
||||||
omnipodPumpPlugin.setEnableCustomAction(OmnipodCustomActionType.FillCanulaSetBasalProfile, false);
|
// omnipodPumpPlugin.setEnableCustomAction(OmnipodCustomActionType.FillCanulaSetBasalProfile, false);
|
||||||
}
|
// }
|
||||||
omnipodPumpPlugin.setEnableCustomAction(OmnipodCustomActionType.DeactivatePod, true);
|
// omnipodPumpPlugin.setEnableCustomAction(OmnipodCustomActionType.DeactivatePod, true);
|
||||||
}
|
// }
|
||||||
break;
|
// break;
|
||||||
|
//
|
||||||
case DeactivatePod:
|
// case DeactivatePod:
|
||||||
case ResetPodStatus: {
|
// case ResetPodStatus: {
|
||||||
omnipodPumpPlugin.setEnableCustomAction(OmnipodCustomActionType.PairAndPrime, true);
|
// omnipodPumpPlugin.setEnableCustomAction(OmnipodCustomActionType.PairAndPrime, true);
|
||||||
omnipodPumpPlugin.setEnableCustomAction(OmnipodCustomActionType.DeactivatePod, false);
|
// omnipodPumpPlugin.setEnableCustomAction(OmnipodCustomActionType.DeactivatePod, false);
|
||||||
}
|
// }
|
||||||
break;
|
// break;
|
||||||
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -272,10 +272,11 @@ public class OmnipodDashPumpPlugin extends OmnipodPumpPlugin implements OmnipodP
|
||||||
|
|
||||||
if (customActions == null) {
|
if (customActions == null) {
|
||||||
this.customActions = Arrays.asList(
|
this.customActions = Arrays.asList(
|
||||||
customActionPairAndPrime, //
|
// customActionPairAndPrime, //
|
||||||
customActionFillCanullaSetBasalProfile, //
|
// customActionFillCanullaSetBasalProfile, //
|
||||||
customActionDeactivatePod, //
|
// customActionDeactivatePod, //
|
||||||
customActionResetPod);
|
// customActionResetPod
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.customActions;
|
return this.customActions;
|
||||||
|
|
Loading…
Reference in a new issue