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
|
||||
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 CommandBolus(detailedBolusInfo, callback));
|
||||
|
||||
|
@ -161,14 +165,9 @@ public class CommandQueue {
|
|||
// Notify Wear about upcoming bolus
|
||||
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
|
||||
BolusProgressDialog bolusProgressDialog = null;
|
||||
if (detailedBolusInfo.context != null) {
|
||||
bolusProgressDialog = new BolusProgressDialog();
|
||||
BolusProgressDialog bolusProgressDialog = new BolusProgressDialog();
|
||||
bolusProgressDialog.setInsulin(detailedBolusInfo.insulin);
|
||||
bolusProgressDialog.show(((AppCompatActivity) detailedBolusInfo.context).getSupportFragmentManager(), "BolusProgress");
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue