Merge branch 'queue-bolus-constraints' into combo-scripter-v2
* queue-bolus-constraints: Apply bolus constraint before applying. # Conflicts: # app/src/main/java/info/nightscout/androidaps/queue/CommandQueue.java
This commit is contained in:
commit
9eefae4f67
1 changed files with 5 additions and 6 deletions
|
@ -153,6 +153,10 @@ public class CommandQueue {
|
||||||
// remove all unfinished boluses
|
// remove all unfinished boluses
|
||||||
removeAll(Command.CommandType.BOLUS);
|
removeAll(Command.CommandType.BOLUS);
|
||||||
|
|
||||||
|
// apply constraints
|
||||||
|
detailedBolusInfo.insulin = MainApp.getConfigBuilder().applyBolusConstraints(detailedBolusInfo.insulin);
|
||||||
|
detailedBolusInfo.carbs = MainApp.getConfigBuilder().applyCarbsConstraints((int) detailedBolusInfo.carbs);
|
||||||
|
|
||||||
// add new command to queue
|
// add new command to queue
|
||||||
add(new CommandBolus(detailedBolusInfo, callback));
|
add(new CommandBolus(detailedBolusInfo, callback));
|
||||||
|
|
||||||
|
@ -161,14 +165,9 @@ public class CommandQueue {
|
||||||
// Notify Wear about upcoming bolus
|
// Notify Wear about upcoming bolus
|
||||||
MainApp.bus().post(new EventBolusRequested(detailedBolusInfo.insulin));
|
MainApp.bus().post(new EventBolusRequested(detailedBolusInfo.insulin));
|
||||||
|
|
||||||
// Apply constraints
|
|
||||||
detailedBolusInfo.insulin = MainApp.getConfigBuilder().applyBolusConstraints(detailedBolusInfo.insulin);
|
|
||||||
detailedBolusInfo.carbs = MainApp.getConfigBuilder().applyCarbsConstraints((int) detailedBolusInfo.carbs);
|
|
||||||
|
|
||||||
// Bring up bolus progress dialog
|
// Bring up bolus progress dialog
|
||||||
BolusProgressDialog bolusProgressDialog = null;
|
|
||||||
if (detailedBolusInfo.context != null) {
|
if (detailedBolusInfo.context != null) {
|
||||||
bolusProgressDialog = new BolusProgressDialog();
|
BolusProgressDialog bolusProgressDialog = new BolusProgressDialog();
|
||||||
bolusProgressDialog.setInsulin(detailedBolusInfo.insulin);
|
bolusProgressDialog.setInsulin(detailedBolusInfo.insulin);
|
||||||
bolusProgressDialog.show(((AppCompatActivity) detailedBolusInfo.context).getSupportFragmentManager(), "BolusProgress");
|
bolusProgressDialog.show(((AppCompatActivity) detailedBolusInfo.context).getSupportFragmentManager(), "BolusProgress");
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue