Little bit of cleanup:

- removed some unsused (commented) code
- removed few logs that were very useless
This commit is contained in:
Andy Rozman 2019-11-14 21:22:03 +00:00
parent 1d1549105b
commit 740b795b42
4 changed files with 5 additions and 53 deletions

View file

@ -873,7 +873,6 @@ public class MedtronicPumpPlugin extends PumpPluginAbstract implements PumpInter
detailedBolusInfo.deliverAt = now; // not sure about that one
TreatmentsPlugin.getPlugin().addToHistoryTreatment(detailedBolusInfo, true);
DetailedBolusInfoStorage.INSTANCE.add(detailedBolusInfo);
// we subtract insulin, exact amount will be visible with next remainingInsulin update.
getMDTPumpStatus().reservoirRemainingUnits -= detailedBolusInfo.insulin;

View file

@ -412,25 +412,18 @@ public class MedtronicPumpHistoryDecoder extends MedtronicHistoryDecoder<PumpHis
rate = body[1] * 0.025f;
}
LOG.info("Basal Profile Start: offset={}, rate={}, index={}, body_raw={}", offset, rate, index,
body);
//LOG.info("Basal Profile Start: offset={}, rate={}, index={}, body_raw={}", offset, rate, index, body);
if (rate == null) {
LOG.warn("Basal Profile Start (ERROR): offset={}, rate={}, index={}, body_raw={}", offset, rate, index,
body);
return RecordDecodeStatus.Error;
} else {
// writeData(PumpBaseType.Basal, PumpBasalType.ValueChange, getFormattedFloat(rate, 3),
// entry.getATechDate());
entry.addDecodedData("Value", getFormattedFloat(rate, 3));
entry.setDisplayableValue(getFormattedFloat(rate, 3));
return RecordDecodeStatus.OK;
}
// profileIndex = asUINT8(data[1]);
// offset = asUINT8(data[7]) * 30 * 1000 * 60;
// rate = (double)(asUINT8(data[8])) / 40.0;
}

View file

@ -10,12 +10,10 @@ import java.util.List;
import info.nightscout.androidaps.logging.L;
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)
*
* Created by andy on 9/23/18.
*/
public class PumpHistoryResult {
@ -29,8 +27,6 @@ public class PumpHistoryResult {
public List<PumpHistoryEntry> validEntries;
// private Object validValues;
public PumpHistoryResult(PumpHistoryEntry searchEntry, Long targetDate) {
if (searchEntry != null) {
/*
@ -109,9 +105,8 @@ public class PumpHistoryResult {
if (unprocessedEntry.isAfter(this.searchDate)) {
this.validEntries.add(unprocessedEntry);
} else {
LOG.debug("PE. PumpHistoryResult. Not after.. Unprocessed Entry [year={},entry={}]",
DateTimeUtil.getYear(unprocessedEntry.atechDateTime), unprocessedEntry);
// LOG.debug("PE. PumpHistoryResult. Not after.. Unprocessed Entry [year={},entry={}]",
// DateTimeUtil.getYear(unprocessedEntry.atechDateTime), unprocessedEntry);
if (DateTimeUtil.getYear(unprocessedEntry.atechDateTime) > 2015)
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() {
return "PumpHistoryResult [unprocessed=" + (unprocessedEntries != null ? "" + unprocessedEntries.size() : "0") + //
", valid=" + (validEntries != null ? "" + validEntries.size() : "0") + //

View file

@ -979,33 +979,6 @@ public class MedtronicHistoryData {
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);
}
}