Only do SMB if invoke is from EventNewBG
This commit is contained in:
parent
1bd938c8d5
commit
6ef4b0c2a9
|
@ -260,7 +260,12 @@ public class LoopPlugin implements PluginBase {
|
|||
// check rate for constrais
|
||||
final APSResult resultAfterConstraints = result.clone();
|
||||
resultAfterConstraints.rate = constraintsInterface.applyBasalConstraints(resultAfterConstraints.rate);
|
||||
resultAfterConstraints.smb = constraintsInterface.applyBolusConstraints(resultAfterConstraints.smb);
|
||||
if(initiator == "EventNewBG") {
|
||||
resultAfterConstraints.smb = constraintsInterface.applyBolusConstraints(resultAfterConstraints.smb);
|
||||
} else {
|
||||
log.debug("Loop is not invoked by EventNewBG so SMB is 0("+constraintsInterface.applyBolusConstraints(resultAfterConstraints.smb)+")");
|
||||
resultAfterConstraints.smb = 0.0;
|
||||
}
|
||||
|
||||
if (lastRun == null) lastRun = new LastRun();
|
||||
lastRun.request = result;
|
||||
|
|
Loading…
Reference in a new issue