remove static ConfigBuilderPlugin.activeAPS

This commit is contained in:
Milos Kozak 2018-09-17 17:59:44 +02:00
parent 0b32431f9e
commit 1b086e6776
4 changed files with 6 additions and 6 deletions

View file

@ -43,7 +43,7 @@ public class ConfigBuilderPlugin extends PluginBase {
private BgSourceInterface activeBgSource; private BgSourceInterface activeBgSource;
private PumpInterface activePump; private PumpInterface activePump;
private ProfileInterface activeProfile; private ProfileInterface activeProfile;
private static APSInterface activeAPS; private APSInterface activeAPS;
private static InsulinInterface activeInsulin; private static InsulinInterface activeInsulin;
private static SensitivityInterface activeSensitivity; private static SensitivityInterface activeSensitivity;
@ -244,7 +244,7 @@ public class ConfigBuilderPlugin extends PluginBase {
return activeInsulin; return activeInsulin;
} }
public static APSInterface getActiveAPS() { public APSInterface getActiveAPS() {
return activeAPS; return activeAPS;
} }

View file

@ -68,7 +68,7 @@ public class Objective1 extends Objective {
tasks.add(new Task(R.string.apsselected) { tasks.add(new Task(R.string.apsselected) {
@Override @Override
public boolean isCompleted() { public boolean isCompleted() {
APSInterface usedAPS = ConfigBuilderPlugin.getActiveAPS(); APSInterface usedAPS = ConfigBuilderPlugin.getPlugin().getActiveAPS();
if (usedAPS != null && ((PluginBase) usedAPS).isEnabled(PluginType.APS)) if (usedAPS != null && ((PluginBase) usedAPS).isEnabled(PluginType.APS))
return true; return true;
return false; return false;

View file

@ -293,7 +293,7 @@ public class LoopPlugin extends PluginBase {
// Check if pump info is loaded // Check if pump info is loaded
if (pump.getBaseBasalRate() < 0.01d) return; if (pump.getBaseBasalRate() < 0.01d) return;
APSInterface usedAPS = ConfigBuilderPlugin.getActiveAPS(); APSInterface usedAPS = ConfigBuilderPlugin.getPlugin().getActiveAPS();
if (usedAPS != null && ((PluginBase) usedAPS).isEnabled(PluginType.APS)) { if (usedAPS != null && ((PluginBase) usedAPS).isEnabled(PluginType.APS)) {
usedAPS.invoke(initiator, tempBasalFallback); usedAPS.invoke(initiator, tempBasalFallback);
result = usedAPS.getLastAPSResult(); result = usedAPS.getLastAPSResult();

View file

@ -512,7 +512,7 @@ public class ActionStringHandler {
} else { } else {
ret += "OPEN LOOP\n"; ret += "OPEN LOOP\n";
} }
final APSInterface aps = ConfigBuilderPlugin.getActiveAPS(); final APSInterface aps = ConfigBuilderPlugin.getPlugin().getActiveAPS();
ret += "APS: " + ((aps == null) ? "NO APS SELECTED!" : ((PluginBase) aps).getName()); ret += "APS: " + ((aps == null) ? "NO APS SELECTED!" : ((PluginBase) aps).getName());
if (LoopPlugin.lastRun != null) { if (LoopPlugin.lastRun != null) {
if (LoopPlugin.lastRun.lastAPSRun != null) if (LoopPlugin.lastRun.lastAPSRun != null)
@ -566,7 +566,7 @@ public class ActionStringHandler {
return "No profile set :("; return "No profile set :(";
} }
APSInterface usedAPS = ConfigBuilderPlugin.getActiveAPS(); APSInterface usedAPS = ConfigBuilderPlugin.getPlugin().getActiveAPS();
if (usedAPS == null) { if (usedAPS == null) {
return "No active APS :(!"; return "No active APS :(!";
} }