RS proper evaluate extended bolus result

This commit is contained in:
Milos Kozak 2017-12-01 17:37:49 +01:00
parent aa210970ec
commit faea3a5147
2 changed files with 9 additions and 7 deletions

View file

@ -93,6 +93,7 @@ public class NewExtendedBolusDialog extends DialogFragment implements View.OnCli
ConfigBuilderPlugin.getCommandQueue().extendedBolus(finalInsulin, finalDurationInMinutes, new Callback() { ConfigBuilderPlugin.getCommandQueue().extendedBolus(finalInsulin, finalDurationInMinutes, new Callback() {
@Override @Override
public void run() { public void run() {
if (!result.success) {
Intent i = new Intent(MainApp.instance(), ErrorHelperActivity.class); Intent i = new Intent(MainApp.instance(), ErrorHelperActivity.class);
i.putExtra("soundid", R.raw.boluserror); i.putExtra("soundid", R.raw.boluserror);
i.putExtra("status", result.comment); i.putExtra("status", result.comment);
@ -100,6 +101,7 @@ public class NewExtendedBolusDialog extends DialogFragment implements View.OnCli
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
MainApp.instance().startActivity(i); MainApp.instance().startActivity(i);
} }
}
}); });
Answers.getInstance().logCustom(new CustomEvent("ExtendedBolus")); Answers.getInstance().logCustom(new CustomEvent("ExtendedBolus"));
} }

View file

@ -674,7 +674,7 @@ public class DanaRSPlugin implements PluginBase, PumpInterface, DanaRInterface,
return result; return result;
} }
boolean connectionOK = danaRSService.extendedBolus(insulin, durationInHalfHours); boolean connectionOK = danaRSService.extendedBolus(insulin, durationInHalfHours);
if (connectionOK && pump.isExtendedInProgress && Math.abs(pump.extendedBolusAmount - insulin) < getPumpDescription().extendedBolusStep) { if (connectionOK && pump.isExtendedInProgress && Math.abs(pump.extendedBolusAbsoluteRate - insulin) < getPumpDescription().extendedBolusStep) {
result.enacted = true; result.enacted = true;
result.success = true; result.success = true;
result.comment = MainApp.instance().getString(R.string.virtualpump_resultok); result.comment = MainApp.instance().getString(R.string.virtualpump_resultok);