Merge pull request #1593 from MilosKozak/AdrianLxM-patch-1

Wear bug with Insight-pump: ignore rounding deviations
This commit is contained in:
AdrianLxM 2019-02-02 12:31:37 +01:00 committed by GitHub
commit 3c029906db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -232,8 +232,8 @@ public class ActionStringHandler {
0d, percentage, useBolusIOB, useBasalIOB, false, useTrend); 0d, percentage, useBolusIOB, useBasalIOB, false, useTrend);
Double insulinAfterConstraints = MainApp.getConstraintChecker().applyBolusConstraints(new Constraint<>(bolusWizard.calculatedTotalInsulin)).value(); Double insulinAfterConstraints = MainApp.getConstraintChecker().applyBolusConstraints(new Constraint<>(bolusWizard.calculatedTotalInsulin)).value();
if (insulinAfterConstraints - bolusWizard.calculatedTotalInsulin != 0) { if (Math.abs(insulinAfterConstraints - bolusWizard.calculatedTotalInsulin) >= 0.01) {
sendError("Insulin contraint violation!" + sendError("Insulin constraint violation!" +
"\nCannot deliver " + format.format(bolusWizard.calculatedTotalInsulin) + "!"); "\nCannot deliver " + format.format(bolusWizard.calculatedTotalInsulin) + "!");
return; return;
} }