commit
e3f9954e62
|
@ -199,7 +199,7 @@ public class ComboFragment extends SubscriberFragment implements View.OnClickLis
|
|||
activityView.setTextSize(14);
|
||||
activityView.setText(activity);
|
||||
} else {
|
||||
activityView.setTextSize(18);
|
||||
activityView.setTextSize(20);
|
||||
activityView.setText("{fa-bed}");
|
||||
}
|
||||
|
||||
|
|
|
@ -565,7 +565,9 @@ public class ComboPlugin implements PluginBase, PumpInterface, ConstraintsInterf
|
|||
return new PumpEnactResult().success(false).enacted(true)
|
||||
.comment(MainApp.gs(R.string.combo_error_updating_treatment_record));
|
||||
|
||||
// partial bolus was delivered
|
||||
timestampOfLastKnownPumpBolusRecord = lastPumpBolus.timestamp;
|
||||
|
||||
// only a partial bolus was delivered
|
||||
if (Math.abs(lastPumpBolus.amount - detailedBolusInfo.insulin) > 0.01) {
|
||||
if (cancelBolus) {
|
||||
return new PumpEnactResult().success(true).enacted(true);
|
||||
|
@ -717,11 +719,11 @@ public class ComboPlugin implements PluginBase, PumpInterface, ConstraintsInterf
|
|||
}
|
||||
|
||||
@Override
|
||||
public PumpEnactResult cancelTempBasal(boolean userRequested) {
|
||||
public PumpEnactResult cancelTempBasal(boolean enforceNew) {
|
||||
log.debug("cancelTempBasal called");
|
||||
final TemporaryBasal activeTemp = MainApp.getConfigBuilder().getTempBasalFromHistory(System.currentTimeMillis());
|
||||
if (userRequested) {
|
||||
log.debug("cancelTempBasal: hard-cancelling TBR since user requested");
|
||||
if (enforceNew) {
|
||||
log.debug("cancelTempBasal: hard-cancelling TBR since force requested");
|
||||
CommandResult commandResult = runCommand(MainApp.gs(R.string.combo_pump_action_cancelling_tbr), 2, ruffyScripter::cancelTbr);
|
||||
if (!commandResult.state.tbrActive) {
|
||||
TemporaryBasal tempBasal = new TemporaryBasal();
|
||||
|
@ -737,8 +739,8 @@ public class ComboPlugin implements PluginBase, PumpInterface, ConstraintsInterf
|
|||
return new PumpEnactResult().success(true).enacted(false);
|
||||
} else if ((activeTemp.percentRate >= 90 && activeTemp.percentRate <= 110) && activeTemp.getPlannedRemainingMinutes() <= 15) {
|
||||
// Let fake neutral temp keep run (see below)
|
||||
// Note that a connection to the pump is still opened, since the queue issues a getPumpStatus() call whenever an empty
|
||||
// queue receives a new command. Probably not worth optimizing.
|
||||
// Note that since this runs on the queue a connection is opened regardless, but this
|
||||
// case doesn't occur all that often, so it's not worth optimizing (1.3k SetTBR vs 4 cancelTBR).
|
||||
log.debug("cancelTempBasal: skipping changing tbr since it already is at " + activeTemp.percentRate + "% and running for another " + activeTemp.getPlannedRemainingMinutes() + " mins.");
|
||||
return new PumpEnactResult().success(true).enacted(true)
|
||||
.comment("cancelTempBasal skipping changing tbr since it already is at "
|
||||
|
@ -824,6 +826,9 @@ public class ComboPlugin implements PluginBase, PumpInterface, ConstraintsInterf
|
|||
private CommandResult runOnConnectChecks() {
|
||||
// connect, get status and check if an alarm is active
|
||||
CommandResult preCheckResult = ruffyScripter.readPumpState();
|
||||
for (int retries = 2; !preCheckResult.success && retries > 0; retries--) {
|
||||
preCheckResult = ruffyScripter.readPumpState();
|
||||
}
|
||||
if (!preCheckResult.success) {
|
||||
return preCheckResult;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue