diff --git a/app/src/main/java/info/nightscout/androidaps/db/ExtendedBolus.java b/app/src/main/java/info/nightscout/androidaps/db/ExtendedBolus.java index e2e50e2dec..b4fda73ab6 100644 --- a/app/src/main/java/info/nightscout/androidaps/db/ExtendedBolus.java +++ b/app/src/main/java/info/nightscout/androidaps/db/ExtendedBolus.java @@ -218,7 +218,7 @@ public class ExtendedBolus implements Interval, DataPointWithLabelInterface { public IobTotal iobCalc(long time) { IobTotal result = new IobTotal(time); - InsulinInterface insulinInterface = ConfigBuilderPlugin.getActiveInsulin(); + InsulinInterface insulinInterface = ConfigBuilderPlugin.getPlugin().getActiveInsulin(); int realDuration = getDurationToTime(time); diff --git a/app/src/main/java/info/nightscout/androidaps/db/TemporaryBasal.java b/app/src/main/java/info/nightscout/androidaps/db/TemporaryBasal.java index f36e9ae6c4..eeaa8c0ee7 100644 --- a/app/src/main/java/info/nightscout/androidaps/db/TemporaryBasal.java +++ b/app/src/main/java/info/nightscout/androidaps/db/TemporaryBasal.java @@ -228,7 +228,7 @@ public class TemporaryBasal implements Interval { } IobTotal result = new IobTotal(time); - InsulinInterface insulinInterface = ConfigBuilderPlugin.getActiveInsulin(); + InsulinInterface insulinInterface = ConfigBuilderPlugin.getPlugin().getActiveInsulin(); int realDuration = getDurationToTime(time); double netBasalAmount = 0d; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderPlugin.java index 95a89c58e0..f6f75f7dec 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderPlugin.java @@ -44,7 +44,7 @@ public class ConfigBuilderPlugin extends PluginBase { private PumpInterface activePump; private ProfileInterface activeProfile; private APSInterface activeAPS; - private static InsulinInterface activeInsulin; + private InsulinInterface activeInsulin; private static SensitivityInterface activeSensitivity; private static ArrayList pluginList; @@ -240,7 +240,7 @@ public class ConfigBuilderPlugin extends PluginBase { return activeProfile; } - public static InsulinInterface getActiveInsulin() { + public InsulinInterface getActiveInsulin() { return activeInsulin; } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Insulin/InsulinFragment.java b/app/src/main/java/info/nightscout/androidaps/plugins/Insulin/InsulinFragment.java index a524a5b318..79db5e1a8b 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Insulin/InsulinFragment.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Insulin/InsulinFragment.java @@ -50,10 +50,10 @@ public class InsulinFragment extends Fragment { } private void updateGUI() { - insulinName.setText(ConfigBuilderPlugin.getActiveInsulin().getFriendlyName()); - insulinComment.setText(ConfigBuilderPlugin.getActiveInsulin().getComment()); - insulinDia.setText(MainApp.gs(R.string.dia) + " " + Double.toString(ConfigBuilderPlugin.getActiveInsulin().getDia()) + "h"); - insulinGraph.show(ConfigBuilderPlugin.getActiveInsulin()); + insulinName.setText(ConfigBuilderPlugin.getPlugin().getActiveInsulin().getFriendlyName()); + insulinComment.setText(ConfigBuilderPlugin.getPlugin().getActiveInsulin().getComment()); + insulinDia.setText(MainApp.gs(R.string.dia) + " " + Double.toString(ConfigBuilderPlugin.getPlugin().getActiveInsulin().getDia()) + "h"); + insulinGraph.show(ConfigBuilderPlugin.getPlugin().getActiveInsulin()); } } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/Treatment.java b/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/Treatment.java index 2e9dfdd5ea..bd3526c043 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/Treatment.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/Treatment.java @@ -242,7 +242,7 @@ public class Treatment implements DataPointWithLabelInterface { if (!isValid) return new Iob(); - InsulinInterface insulinInterface = ConfigBuilderPlugin.getActiveInsulin(); + InsulinInterface insulinInterface = ConfigBuilderPlugin.getPlugin().getActiveInsulin(); return insulinInterface.iobCalcForTreatment(this, time, dia); } }