fix TB & EB is not set
This commit is contained in:
parent
73687442c8
commit
8bbee37b70
1 changed files with 8 additions and 4 deletions
|
@ -573,7 +573,8 @@ public class DanaRSPlugin implements PluginBase, PumpInterface, DanaRInterface,
|
||||||
}
|
}
|
||||||
if (percent > getPumpDescription().maxTempPercent)
|
if (percent > getPumpDescription().maxTempPercent)
|
||||||
percent = getPumpDescription().maxTempPercent;
|
percent = getPumpDescription().maxTempPercent;
|
||||||
if (pump.isTempBasalInProgress && pump.tempBasalPercent == percent) {
|
TemporaryBasal runningTB = MainApp.getConfigBuilder().getTempBasalFromHistory(System.currentTimeMillis());
|
||||||
|
if (runningTB != null && runningTB.percentRate == percent) {
|
||||||
result.enacted = false;
|
result.enacted = false;
|
||||||
result.success = true;
|
result.success = true;
|
||||||
result.isTempCancel = false;
|
result.isTempCancel = false;
|
||||||
|
@ -639,7 +640,8 @@ public class DanaRSPlugin implements PluginBase, PumpInterface, DanaRInterface,
|
||||||
int durationInHalfHours = Math.max(durationInMinutes / 30, 1);
|
int durationInHalfHours = Math.max(durationInMinutes / 30, 1);
|
||||||
insulin = Round.roundTo(insulin, getPumpDescription().extendedBolusStep * (1 + durationInHalfHours % 1));
|
insulin = Round.roundTo(insulin, getPumpDescription().extendedBolusStep * (1 + durationInHalfHours % 1));
|
||||||
PumpEnactResult result = new PumpEnactResult();
|
PumpEnactResult result = new PumpEnactResult();
|
||||||
if (pump.isExtendedInProgress && Math.abs(pump.extendedBolusAmount - insulin) < getPumpDescription().extendedBolusStep) {
|
ExtendedBolus runningEB = MainApp.getConfigBuilder().getExtendedBolusFromHistory(System.currentTimeMillis());
|
||||||
|
if (runningEB != null && Math.abs(runningEB.insulin - insulin) < getPumpDescription().extendedBolusStep) {
|
||||||
result.enacted = false;
|
result.enacted = false;
|
||||||
result.success = true;
|
result.success = true;
|
||||||
result.comment = MainApp.instance().getString(R.string.virtualpump_resultok);
|
result.comment = MainApp.instance().getString(R.string.virtualpump_resultok);
|
||||||
|
@ -676,7 +678,8 @@ public class DanaRSPlugin implements PluginBase, PumpInterface, DanaRInterface,
|
||||||
@Override
|
@Override
|
||||||
public PumpEnactResult cancelTempBasal(boolean force) {
|
public PumpEnactResult cancelTempBasal(boolean force) {
|
||||||
PumpEnactResult result = new PumpEnactResult();
|
PumpEnactResult result = new PumpEnactResult();
|
||||||
if (pump.isTempBasalInProgress) {
|
TemporaryBasal runningTB = MainApp.getConfigBuilder().getTempBasalFromHistory(System.currentTimeMillis());
|
||||||
|
if (runningTB != null) {
|
||||||
connectIfNotConnected("tempBasalStop");
|
connectIfNotConnected("tempBasalStop");
|
||||||
danaRSService.tempBasalStop();
|
danaRSService.tempBasalStop();
|
||||||
result.enacted = true;
|
result.enacted = true;
|
||||||
|
@ -701,7 +704,8 @@ public class DanaRSPlugin implements PluginBase, PumpInterface, DanaRInterface,
|
||||||
@Override
|
@Override
|
||||||
public PumpEnactResult cancelExtendedBolus() {
|
public PumpEnactResult cancelExtendedBolus() {
|
||||||
PumpEnactResult result = new PumpEnactResult();
|
PumpEnactResult result = new PumpEnactResult();
|
||||||
if (pump.isExtendedInProgress) {
|
ExtendedBolus runningEB = MainApp.getConfigBuilder().getExtendedBolusFromHistory(System.currentTimeMillis());
|
||||||
|
if (runningEB != null) {
|
||||||
connectIfNotConnected("extendedBolusStop");
|
connectIfNotConnected("extendedBolusStop");
|
||||||
danaRSService.extendedBolusStop();
|
danaRSService.extendedBolusStop();
|
||||||
result.enacted = true;
|
result.enacted = true;
|
||||||
|
|
Loading…
Reference in a new issue