Little bit of cleanup:
- removed some unsused (commented) code - removed few logs that were very useless
This commit is contained in:
parent
1d1549105b
commit
740b795b42
4 changed files with 5 additions and 53 deletions
|
@ -873,7 +873,6 @@ public class MedtronicPumpPlugin extends PumpPluginAbstract implements PumpInter
|
||||||
detailedBolusInfo.deliverAt = now; // not sure about that one
|
detailedBolusInfo.deliverAt = now; // not sure about that one
|
||||||
|
|
||||||
TreatmentsPlugin.getPlugin().addToHistoryTreatment(detailedBolusInfo, true);
|
TreatmentsPlugin.getPlugin().addToHistoryTreatment(detailedBolusInfo, true);
|
||||||
DetailedBolusInfoStorage.INSTANCE.add(detailedBolusInfo);
|
|
||||||
|
|
||||||
// we subtract insulin, exact amount will be visible with next remainingInsulin update.
|
// we subtract insulin, exact amount will be visible with next remainingInsulin update.
|
||||||
getMDTPumpStatus().reservoirRemainingUnits -= detailedBolusInfo.insulin;
|
getMDTPumpStatus().reservoirRemainingUnits -= detailedBolusInfo.insulin;
|
||||||
|
|
|
@ -412,25 +412,18 @@ public class MedtronicPumpHistoryDecoder extends MedtronicHistoryDecoder<PumpHis
|
||||||
rate = body[1] * 0.025f;
|
rate = body[1] * 0.025f;
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG.info("Basal Profile Start: offset={}, rate={}, index={}, body_raw={}", offset, rate, index,
|
//LOG.info("Basal Profile Start: offset={}, rate={}, index={}, body_raw={}", offset, rate, index, body);
|
||||||
body);
|
|
||||||
|
|
||||||
if (rate == null) {
|
if (rate == null) {
|
||||||
LOG.warn("Basal Profile Start (ERROR): offset={}, rate={}, index={}, body_raw={}", offset, rate, index,
|
LOG.warn("Basal Profile Start (ERROR): offset={}, rate={}, index={}, body_raw={}", offset, rate, index,
|
||||||
body);
|
body);
|
||||||
return RecordDecodeStatus.Error;
|
return RecordDecodeStatus.Error;
|
||||||
} else {
|
} else {
|
||||||
// writeData(PumpBaseType.Basal, PumpBasalType.ValueChange, getFormattedFloat(rate, 3),
|
|
||||||
// entry.getATechDate());
|
|
||||||
entry.addDecodedData("Value", getFormattedFloat(rate, 3));
|
entry.addDecodedData("Value", getFormattedFloat(rate, 3));
|
||||||
entry.setDisplayableValue(getFormattedFloat(rate, 3));
|
entry.setDisplayableValue(getFormattedFloat(rate, 3));
|
||||||
return RecordDecodeStatus.OK;
|
return RecordDecodeStatus.OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
// profileIndex = asUINT8(data[1]);
|
|
||||||
// offset = asUINT8(data[7]) * 30 * 1000 * 60;
|
|
||||||
// rate = (double)(asUINT8(data[8])) / 40.0;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -10,12 +10,10 @@ import java.util.List;
|
||||||
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 andy on 9/23/18.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* History page contains data, sorted from newest to oldest (0=newest..n=oldest)
|
* History page contains data, sorted from newest to oldest (0=newest..n=oldest)
|
||||||
|
*
|
||||||
|
* Created by andy on 9/23/18.
|
||||||
*/
|
*/
|
||||||
public class PumpHistoryResult {
|
public class PumpHistoryResult {
|
||||||
|
|
||||||
|
@ -29,8 +27,6 @@ public class PumpHistoryResult {
|
||||||
public List<PumpHistoryEntry> validEntries;
|
public List<PumpHistoryEntry> validEntries;
|
||||||
|
|
||||||
|
|
||||||
// private Object validValues;
|
|
||||||
|
|
||||||
public PumpHistoryResult(PumpHistoryEntry searchEntry, Long targetDate) {
|
public PumpHistoryResult(PumpHistoryEntry searchEntry, Long targetDate) {
|
||||||
if (searchEntry != null) {
|
if (searchEntry != null) {
|
||||||
/*
|
/*
|
||||||
|
@ -109,9 +105,8 @@ public class PumpHistoryResult {
|
||||||
if (unprocessedEntry.isAfter(this.searchDate)) {
|
if (unprocessedEntry.isAfter(this.searchDate)) {
|
||||||
this.validEntries.add(unprocessedEntry);
|
this.validEntries.add(unprocessedEntry);
|
||||||
} else {
|
} else {
|
||||||
LOG.debug("PE. PumpHistoryResult. Not after.. Unprocessed Entry [year={},entry={}]",
|
// LOG.debug("PE. PumpHistoryResult. Not after.. Unprocessed Entry [year={},entry={}]",
|
||||||
DateTimeUtil.getYear(unprocessedEntry.atechDateTime), unprocessedEntry);
|
// DateTimeUtil.getYear(unprocessedEntry.atechDateTime), unprocessedEntry);
|
||||||
|
|
||||||
if (DateTimeUtil.getYear(unprocessedEntry.atechDateTime) > 2015)
|
if (DateTimeUtil.getYear(unprocessedEntry.atechDateTime) > 2015)
|
||||||
olderEntries++;
|
olderEntries++;
|
||||||
}
|
}
|
||||||
|
@ -131,14 +126,6 @@ public class PumpHistoryResult {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void clearOrPrepareList() {
|
|
||||||
if (this.validEntries == null)
|
|
||||||
this.validEntries = new ArrayList<>();
|
|
||||||
else
|
|
||||||
this.validEntries.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "PumpHistoryResult [unprocessed=" + (unprocessedEntries != null ? "" + unprocessedEntries.size() : "0") + //
|
return "PumpHistoryResult [unprocessed=" + (unprocessedEntries != null ? "" + unprocessedEntries.size() : "0") + //
|
||||||
", valid=" + (validEntries != null ? "" + validEntries.size() : "0") + //
|
", valid=" + (validEntries != null ? "" + validEntries.size() : "0") + //
|
||||||
|
|
|
@ -979,33 +979,6 @@ public class MedtronicHistoryData {
|
||||||
|
|
||||||
bolus.setLinkedObject(treatment);
|
bolus.setLinkedObject(treatment);
|
||||||
|
|
||||||
// DetailedBolusInfo detailedBolusInfo = DetailedBolusInfoStorage.INSTANCE.findDetailedBolusInfo(treatment.date, bolusDTO.getDeliveredAmount());
|
|
||||||
//
|
|
||||||
// if (doubleBolusDebug)
|
|
||||||
// LOG.debug("DoubleBolusDebug: addBolus(tretament={}): Bolus={}, DetailedBolusInfo={}", treatment, bolusDTO, detailedBolusInfo);
|
|
||||||
//
|
|
||||||
// if (detailedBolusInfo == null) {
|
|
||||||
// detailedBolusInfo = new DetailedBolusInfo();
|
|
||||||
//
|
|
||||||
// if (doubleBolusDebug)
|
|
||||||
// LOG.debug("DoubleBolusDebug: detailedBolusInfoCouldNotBeRetrived !");
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// detailedBolusInfo.date = treatment.date;
|
|
||||||
// detailedBolusInfo.source = Source.PUMP;
|
|
||||||
// detailedBolusInfo.pumpId = bolus.getPumpId();
|
|
||||||
// detailedBolusInfo.insulin = bolusDTO.getDeliveredAmount();
|
|
||||||
// detailedBolusInfo.carbs = treatment.carbs;
|
|
||||||
//
|
|
||||||
// addCarbsFromEstimate(detailedBolusInfo, bolus);
|
|
||||||
//
|
|
||||||
// if (doubleBolusDebug)
|
|
||||||
// LOG.debug("DoubleBolusDebug: addBolus(tretament!=null): DetailedBolusInfo(New)={}", detailedBolusInfo);
|
|
||||||
//
|
|
||||||
// boolean newRecord = TreatmentsPlugin.getPlugin().addToHistoryTreatment(detailedBolusInfo, false);
|
|
||||||
//
|
|
||||||
// bolus.setLinkedObject(detailedBolusInfo);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue