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:
parent
8577a94571
commit
21f231e2b3
1 changed files with 16 additions and 12 deletions
|
@ -801,19 +801,23 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
|
||||||
detailedBolusInfo.context = context;
|
detailedBolusInfo.context = context;
|
||||||
detailedBolusInfo.boluscalc = boluscalcJSON;
|
detailedBolusInfo.boluscalc = boluscalcJSON;
|
||||||
detailedBolusInfo.source = Source.USER;
|
detailedBolusInfo.source = Source.USER;
|
||||||
ConfigBuilderPlugin.getCommandQueue().bolus(detailedBolusInfo, new Callback() {
|
if (finalInsulinAfterConstraints > 0 || ConfigBuilderPlugin.getActivePump().getPumpDescription().storesCarbInfo) {
|
||||||
@Override
|
ConfigBuilderPlugin.getCommandQueue().bolus(detailedBolusInfo, new Callback() {
|
||||||
public void run() {
|
@Override
|
||||||
if (!result.success) {
|
public void run() {
|
||||||
Intent i = new Intent(MainApp.instance(), ErrorHelperActivity.class);
|
if (!result.success) {
|
||||||
i.putExtra("soundid", R.raw.boluserror);
|
Intent i = new Intent(MainApp.instance(), ErrorHelperActivity.class);
|
||||||
i.putExtra("status", result.comment);
|
i.putExtra("soundid", R.raw.boluserror);
|
||||||
i.putExtra("title", MainApp.gs(R.string.treatmentdeliveryerror));
|
i.putExtra("status", result.comment);
|
||||||
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
i.putExtra("title", MainApp.gs(R.string.treatmentdeliveryerror));
|
||||||
MainApp.instance().startActivity(i);
|
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
|
MainApp.instance().startActivity(i);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
} else {
|
||||||
|
TreatmentsPlugin.getPlugin().addToHistoryTreatment(detailedBolusInfo);
|
||||||
|
}
|
||||||
FabricPrivacy.getInstance().logCustom(new CustomEvent("QuickWizard"));
|
FabricPrivacy.getInstance().logCustom(new CustomEvent("QuickWizard"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue