Remove combo hacks outside of combo plugin.
This commit is contained in:
parent
357c84e2e2
commit
5131b8b62f
|
@ -152,7 +152,7 @@ public class PreferencesActivity extends PreferenceActivity implements SharedPre
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (Config.COMBO) {
|
if (Config.COMBO) {
|
||||||
ComboPlugin comboPlugin = (ComboPlugin) MainApp.getSpecificPlugin(ComboPlugin.class);
|
ComboPlugin comboPlugin = MainApp.getSpecificPlugin(ComboPlugin.class);
|
||||||
if (comboPlugin.isEnabled(PluginBase.PUMP)) {
|
if (comboPlugin.isEnabled(PluginBase.PUMP)) {
|
||||||
addPreferencesFromResource(R.xml.pref_combo);
|
addPreferencesFromResource(R.xml.pref_combo);
|
||||||
}
|
}
|
||||||
|
|
|
@ -252,11 +252,6 @@ public class TemporaryBasal implements Interval {
|
||||||
return Math.round(msecs / 60f / 1000);
|
return Math.round(msecs / 60f / 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getPlannedRemainingSeconds() {
|
|
||||||
Float remainingMin = (end() - System.currentTimeMillis()) / 1000f;
|
|
||||||
return remainingMin.intValue();
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getPlannedRemainingMinutes() {
|
public int getPlannedRemainingMinutes() {
|
||||||
float remainingMin = (end() - System.currentTimeMillis()) / 1000f / 60;
|
float remainingMin = (end() - System.currentTimeMillis()) / 1000f / 60;
|
||||||
return (remainingMin < 0) ? 0 : Math.round(remainingMin);
|
return (remainingMin < 0) ? 0 : Math.round(remainingMin);
|
||||||
|
@ -285,8 +280,6 @@ public class TemporaryBasal implements Interval {
|
||||||
", isAbsolute=" + isAbsolute +
|
", isAbsolute=" + isAbsolute +
|
||||||
", isFakeExtended=" + isFakeExtended +
|
", isFakeExtended=" + isFakeExtended +
|
||||||
", netExtendedRate=" + netExtendedRate +
|
", netExtendedRate=" + netExtendedRate +
|
||||||
", minutesRemaining=" + getPlannedRemainingMinutes() +
|
|
||||||
", secondsRemaining=" + getPlannedRemainingSeconds() +
|
|
||||||
'}';
|
'}';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -582,10 +582,7 @@ public class ConfigBuilderPlugin implements PluginBase, PumpInterface, Constrain
|
||||||
result.comment = "Temp basal set correctly";
|
result.comment = "Temp basal set correctly";
|
||||||
result.success = true;
|
result.success = true;
|
||||||
if (Config.logCongigBuilderActions)
|
if (Config.logCongigBuilderActions)
|
||||||
log.debug("applyAPSRequest: Temp basal set correctly "
|
log.debug("applyAPSRequest: Temp basal set correctly");
|
||||||
+ "(no pump request needed, pump is still running requested rate of "
|
|
||||||
+ request.rate + " for "
|
|
||||||
+ (int) getTempBasalRemainingMinutesFromHistory() + " more minutes)");
|
|
||||||
} else {
|
} else {
|
||||||
if (Config.logCongigBuilderActions)
|
if (Config.logCongigBuilderActions)
|
||||||
log.debug("applyAPSRequest: setTempBasalAbsolute()");
|
log.debug("applyAPSRequest: setTempBasalAbsolute()");
|
||||||
|
|
|
@ -266,7 +266,7 @@ public class LoopPlugin implements PluginBase {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check rate for constraints
|
// check rate for constrais
|
||||||
final APSResult resultAfterConstraints = result.clone();
|
final APSResult resultAfterConstraints = result.clone();
|
||||||
resultAfterConstraints.rate = constraintsInterface.applyBasalConstraints(resultAfterConstraints.rate);
|
resultAfterConstraints.rate = constraintsInterface.applyBasalConstraints(resultAfterConstraints.rate);
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,6 @@ import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.ServiceConnection;
|
import android.content.ServiceConnection;
|
||||||
import android.os.IBinder;
|
import android.os.IBinder;
|
||||||
import android.support.annotation.NonNull;
|
|
||||||
import android.support.annotation.Nullable;
|
import android.support.annotation.Nullable;
|
||||||
|
|
||||||
import com.squareup.otto.Subscribe;
|
import com.squareup.otto.Subscribe;
|
||||||
|
@ -67,7 +66,6 @@ public class DanaRPlugin implements PluginBase, PumpInterface, DanaRInterface, C
|
||||||
private static DanaRExecutionService sExecutionService;
|
private static DanaRExecutionService sExecutionService;
|
||||||
|
|
||||||
|
|
||||||
@NonNull
|
|
||||||
private static DanaRPump pump = DanaRPump.getInstance();
|
private static DanaRPump pump = DanaRPump.getInstance();
|
||||||
private static boolean useExtendedBoluses = false;
|
private static boolean useExtendedBoluses = false;
|
||||||
|
|
||||||
|
@ -761,17 +759,21 @@ public class DanaRPlugin implements PluginBase, PumpInterface, DanaRInterface, C
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("PointlessBooleanExpression")
|
||||||
@Override
|
@Override
|
||||||
public Double applyBasalConstraints(Double absoluteRate) {
|
public Double applyBasalConstraints(Double absoluteRate) {
|
||||||
double origAbsoluteRate = absoluteRate;
|
double origAbsoluteRate = absoluteRate;
|
||||||
|
if (pump != null) {
|
||||||
if (absoluteRate > pump.maxBasal) {
|
if (absoluteRate > pump.maxBasal) {
|
||||||
absoluteRate = pump.maxBasal;
|
absoluteRate = pump.maxBasal;
|
||||||
if (Config.logConstraintsChanges && origAbsoluteRate != Constants.basalAbsoluteOnlyForCheckLimit)
|
if (Config.logConstraintsChanges && origAbsoluteRate != Constants.basalAbsoluteOnlyForCheckLimit)
|
||||||
log.debug("Limiting rate " + origAbsoluteRate + "U/h by pump constraint to " + absoluteRate + "U/h");
|
log.debug("Limiting rate " + origAbsoluteRate + "U/h by pump constraint to " + absoluteRate + "U/h");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return absoluteRate;
|
return absoluteRate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("PointlessBooleanExpression")
|
||||||
@Override
|
@Override
|
||||||
public Integer applyBasalConstraints(Integer percentRate) {
|
public Integer applyBasalConstraints(Integer percentRate) {
|
||||||
Integer origPercentRate = percentRate;
|
Integer origPercentRate = percentRate;
|
||||||
|
@ -783,14 +785,17 @@ public class DanaRPlugin implements PluginBase, PumpInterface, DanaRInterface, C
|
||||||
return percentRate;
|
return percentRate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("PointlessBooleanExpression")
|
||||||
@Override
|
@Override
|
||||||
public Double applyBolusConstraints(Double insulin) {
|
public Double applyBolusConstraints(Double insulin) {
|
||||||
double origInsulin = insulin;
|
double origInsulin = insulin;
|
||||||
|
if (pump != null) {
|
||||||
if (insulin > pump.maxBolus) {
|
if (insulin > pump.maxBolus) {
|
||||||
insulin = pump.maxBolus;
|
insulin = pump.maxBolus;
|
||||||
if (Config.logConstraintsChanges && origInsulin != Constants.bolusOnlyForCheckLimit)
|
if (Config.logConstraintsChanges && origInsulin != Constants.bolusOnlyForCheckLimit)
|
||||||
log.debug("Limiting bolus " + origInsulin + "U by pump constraint to " + insulin + "U");
|
log.debug("Limiting bolus " + origInsulin + "U by pump constraint to " + insulin + "U");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return insulin;
|
return insulin;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -283,9 +283,7 @@ public class TreatmentsPlugin implements PluginBase, TreatmentsInterface {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isTempBasalInProgress() {
|
public boolean isTempBasalInProgress() {
|
||||||
TemporaryBasal tempBasalFromHistory = getTempBasalFromHistory(System.currentTimeMillis());
|
return getTempBasalFromHistory(System.currentTimeMillis()) != null;
|
||||||
log.debug("activeTempbasal: " + tempBasalFromHistory);
|
|
||||||
return tempBasalFromHistory != null && tempBasalFromHistory.getPlannedRemainingSeconds() > 60;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -441,7 +441,7 @@ public class ActionStringHandler {
|
||||||
ret += "OPEN LOOP\n";
|
ret += "OPEN LOOP\n";
|
||||||
}
|
}
|
||||||
final APSInterface aps = MainApp.getConfigBuilder().getActiveAPS();
|
final APSInterface aps = MainApp.getConfigBuilder().getActiveAPS();
|
||||||
ret += "APS: " + ((aps == null) ? R.string.noapsselected : ((PluginBase) aps).getName());
|
ret += "APS: " + ((aps == null) ? "NO APS SELECTED!" : ((PluginBase) aps).getName());
|
||||||
if (activeloop.lastRun != null) {
|
if (activeloop.lastRun != null) {
|
||||||
if (activeloop.lastRun.lastAPSRun != null)
|
if (activeloop.lastRun.lastAPSRun != null)
|
||||||
ret += "\nLast Run: " + DateUtil.timeString(activeloop.lastRun.lastAPSRun);
|
ret += "\nLast Run: " + DateUtil.timeString(activeloop.lastRun.lastAPSRun);
|
||||||
|
|
|
@ -751,23 +751,18 @@
|
||||||
<string name="connectiontimedout">Connection timed out</string>
|
<string name="connectiontimedout">Connection timed out</string>
|
||||||
<string name="bolusstopping">Stopping bolus delivery</string>
|
<string name="bolusstopping">Stopping bolus delivery</string>
|
||||||
<string name="bolusstopped">Bolus delivery stopped</string>
|
<string name="bolusstopped">Bolus delivery stopped</string>
|
||||||
<string name="key_combo_enable_experimental_features">combo_enable_experimental_features</string>
|
<string name="key_combo_enable_experimental_features" translatable="false">combo_enable_experimental_features</string>
|
||||||
<string name="combo_enable_experimental_features">Enable experimental features</string>
|
<string name="combo_enable_experimental_features">Enable experimental features</string>
|
||||||
<string name="combo_enable_experimental_features_summary">Unlocks experimental features which are in development and might be broken entirely.</string>
|
<string name="combo_enable_experimental_features_summary">Unlocks experimental features which are in development and might be broken entirely.</string>
|
||||||
<string name="key_combo_enable_experimental_split_bolus">combo_experimental_split_bolus</string>
|
<string name="key_combo_enable_experimental_split_bolus" translatable="false">combo_experimental_split_bolus</string>
|
||||||
<string name="combo_enable_experimental_split_bolus">Experimental split bolus feature</string>
|
<string name="combo_enable_experimental_split_bolus">Experimental split bolus feature</string>
|
||||||
<string name="combo_enable_experimental_split_bolus_summary">Splits boluses into 2 U parts and waits around 45s after each to slow down bolus delivery (only active with non-experimental bolus).</string>
|
<string name="combo_enable_experimental_split_bolus_summary">Splits boluses into 2 U parts and waits around 45s after each to slow down bolus delivery (only active with non-experimental bolus).</string>
|
||||||
<string name="key_combo_experimental_skip_tbr_changes_below_delta">combo_experimental_reject_tbr_changes_below_delta</string>
|
<string name="key_combo_experimental_skip_tbr_changes_below_delta" translatable="false">combo_experimental_reject_tbr_changes_below_delta</string>
|
||||||
<string name="combo_experimental_skip_tbr_changes_below_delta">Skip TBR changes below threshold (%).</string>
|
<string name="combo_experimental_skip_tbr_changes_below_delta">Skip TBR changes below threshold (%).</string>
|
||||||
<string name="combo_experimental_skip_tbr_changes_below_delta_summary">Don\'t set a TBR if the difference between the new and a running TBR is below this threshold in percent. Specifying 0 disables this option.</string>
|
<string name="combo_experimental_skip_tbr_changes_below_delta_summary">Don\'t set a TBR if the difference between the new and a running TBR is below this threshold in percent. Specifying 0 disables this option.</string>
|
||||||
<string name="key_combo_disable_alerts">combo_disable_alerts</string>
|
<string name="key_combo_disable_alerts" translatable="false">combo_disable_alerts</string>
|
||||||
<string name="combo_disable_alerts">Disable alerts</string>
|
<string name="combo_disable_alerts">Disable alerts</string>
|
||||||
<string name="combo_disable_alerts_summary">Ignore all errors encountered while communicating with the pump. Alerts raised by the pump (including those caused by AAPS) will still be raised.</string>
|
<string name="combo_disable_alerts_summary">Ignore all errors encountered while communicating with the pump. Alerts raised by the pump (including those caused by AAPS) will still be raised.</string>
|
||||||
<string name="bolusprogramming">Programming pump for bolusing</string>
|
<string name="bolusprogramming">Programming pump for bolusing</string>
|
||||||
<string name="key_wizard_include_bg">wizard_include_bg</string>
|
|
||||||
<string name="key_wizard_include_cob">wizard_include_cob</string>
|
|
||||||
<string name="key_wizard_include_trend_bg">wizard_include_trend_bg</string>
|
|
||||||
<string name="key_wizard_include_bolus_iob">wizard_include_bolus_iob</string>
|
|
||||||
<string name="key_wizard_include_basal_iob">wizard_include_basal_iob</string>
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue