Merge pull request #1989 from andyrozman/mdt_fake_percent_tbr
- added fake method TBR Percent. If pecent is 0, it calls absolute me…
This commit is contained in:
commit
c653a95912
1 changed files with 15 additions and 0 deletions
|
@ -1062,6 +1062,21 @@ public class MedtronicPumpPlugin extends PumpPluginAbstract implements PumpInter
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PumpEnactResult setTempBasalPercent(Integer percent, Integer durationInMinutes, Profile profile,
|
||||||
|
boolean enforceNew) {
|
||||||
|
if (percent==0) {
|
||||||
|
return setTempBasalAbsolute(0.0d, durationInMinutes, profile, enforceNew);
|
||||||
|
} else {
|
||||||
|
double absoluteValue = profile.getBasal() * (percent /100.0d);
|
||||||
|
getMDTPumpStatus();
|
||||||
|
absoluteValue = pumpStatusLocal.pumpType.determineCorrectBasalSize(absoluteValue);
|
||||||
|
LOG.warn("setTempBasalPercent [MedtronicPumpPlugin] - You are trying to use setTempBasalPercent with percent other then 0% (%d). This will start setTempBasalAbsolute, with calculated value (%.3f). Result might not be 100% correct.", percent, absoluteValue);
|
||||||
|
return setTempBasalAbsolute(absoluteValue, durationInMinutes, profile, enforceNew);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private void finishAction(String overviewKey) {
|
private void finishAction(String overviewKey) {
|
||||||
|
|
||||||
if (overviewKey != null)
|
if (overviewKey != null)
|
||||||
|
|
Loading…
Reference in a new issue