Insight fix issues
This commit is contained in:
parent
ca000a5f33
commit
35096288e2
1 changed files with 10 additions and 1 deletions
|
@ -507,7 +507,7 @@ public class LocalInsightPlugin extends PluginBase implements PumpInterface, Con
|
||||||
nextValue = profile.getBasalValues()[i + 1];
|
nextValue = profile.getBasalValues()[i + 1];
|
||||||
if (profileBlock.getDuration() * 60 != (nextValue != null ? nextValue.timeAsSeconds : 24 * 60 * 60) - basalValue.timeAsSeconds)
|
if (profileBlock.getDuration() * 60 != (nextValue != null ? nextValue.timeAsSeconds : 24 * 60 * 60) - basalValue.timeAsSeconds)
|
||||||
return false;
|
return false;
|
||||||
if (Math.abs(profileBlock.getBasalAmount() - basalValue.value) > (basalValue.value > 5 ? 0.05 : 0.005))
|
if (Math.abs(profileBlock.getBasalAmount() - basalValue.value) > (basalValue.value > 5 ? 0.051 : 0.0051))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -571,6 +571,15 @@ public class LocalInsightPlugin extends PluginBase implements PumpInterface, Con
|
||||||
detailedBolusInfo.date = insightBolusID.timestamp;
|
detailedBolusInfo.date = insightBolusID.timestamp;
|
||||||
detailedBolusInfo.source = Source.PUMP;
|
detailedBolusInfo.source = Source.PUMP;
|
||||||
detailedBolusInfo.pumpId = insightBolusID.id;
|
detailedBolusInfo.pumpId = insightBolusID.id;
|
||||||
|
if (detailedBolusInfo.carbs > 0 && detailedBolusInfo.carbTime != 0) {
|
||||||
|
DetailedBolusInfo carbInfo = new DetailedBolusInfo();
|
||||||
|
carbInfo.carbs = detailedBolusInfo.carbs;
|
||||||
|
carbInfo.date = detailedBolusInfo.date + detailedBolusInfo.carbTime * 60L * 1000L;
|
||||||
|
carbInfo.source = Source.USER;
|
||||||
|
TreatmentsPlugin.getPlugin().addToHistoryTreatment(carbInfo, false);
|
||||||
|
detailedBolusInfo.carbTime = 0;
|
||||||
|
detailedBolusInfo.carbs = 0;
|
||||||
|
}
|
||||||
TreatmentsPlugin.getPlugin().addToHistoryTreatment(detailedBolusInfo, true);
|
TreatmentsPlugin.getPlugin().addToHistoryTreatment(detailedBolusInfo, true);
|
||||||
while (true) {
|
while (true) {
|
||||||
synchronized ($bolusLock) {
|
synchronized ($bolusLock) {
|
||||||
|
|
Loading…
Reference in a new issue