Calculator: carb-only handling.

If only carbs where entered/calculated, send them to the pump only
 if the pump supports it, otherwise just add it to the DB.
This commit is contained in:
Johannes Mockenhaupt 2018-04-27 16:22:26 +02:00
parent 8577a94571
commit 21f231e2b3
No known key found for this signature in database
GPG key ID: 9E1EA6AF7BBBB0D1

View file

@ -801,6 +801,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
detailedBolusInfo.context = context;
detailedBolusInfo.boluscalc = boluscalcJSON;
detailedBolusInfo.source = Source.USER;
if (finalInsulinAfterConstraints > 0 || ConfigBuilderPlugin.getActivePump().getPumpDescription().storesCarbInfo) {
ConfigBuilderPlugin.getCommandQueue().bolus(detailedBolusInfo, new Callback() {
@Override
public void run() {
@ -814,6 +815,9 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
}
}
});
} else {
TreatmentsPlugin.getPlugin().addToHistoryTreatment(detailedBolusInfo);
}
FabricPrivacy.getInstance().logCustom(new CustomEvent("QuickWizard"));
}
}