remove static ConfigBuilderPlugin.activeInsulin

This commit is contained in:
Milos Kozak 2018-09-17 18:18:50 +02:00
parent 1b086e6776
commit dc563df5f0
5 changed files with 9 additions and 9 deletions

View file

@ -218,7 +218,7 @@ public class ExtendedBolus implements Interval, DataPointWithLabelInterface {
public IobTotal iobCalc(long time) { public IobTotal iobCalc(long time) {
IobTotal result = new IobTotal(time); IobTotal result = new IobTotal(time);
InsulinInterface insulinInterface = ConfigBuilderPlugin.getActiveInsulin(); InsulinInterface insulinInterface = ConfigBuilderPlugin.getPlugin().getActiveInsulin();
int realDuration = getDurationToTime(time); int realDuration = getDurationToTime(time);

View file

@ -228,7 +228,7 @@ public class TemporaryBasal implements Interval {
} }
IobTotal result = new IobTotal(time); IobTotal result = new IobTotal(time);
InsulinInterface insulinInterface = ConfigBuilderPlugin.getActiveInsulin(); InsulinInterface insulinInterface = ConfigBuilderPlugin.getPlugin().getActiveInsulin();
int realDuration = getDurationToTime(time); int realDuration = getDurationToTime(time);
double netBasalAmount = 0d; double netBasalAmount = 0d;

View file

@ -44,7 +44,7 @@ public class ConfigBuilderPlugin extends PluginBase {
private PumpInterface activePump; private PumpInterface activePump;
private ProfileInterface activeProfile; private ProfileInterface activeProfile;
private APSInterface activeAPS; private APSInterface activeAPS;
private static InsulinInterface activeInsulin; private InsulinInterface activeInsulin;
private static SensitivityInterface activeSensitivity; private static SensitivityInterface activeSensitivity;
private static ArrayList<PluginBase> pluginList; private static ArrayList<PluginBase> pluginList;
@ -240,7 +240,7 @@ public class ConfigBuilderPlugin extends PluginBase {
return activeProfile; return activeProfile;
} }
public static InsulinInterface getActiveInsulin() { public InsulinInterface getActiveInsulin() {
return activeInsulin; return activeInsulin;
} }

View file

@ -50,10 +50,10 @@ public class InsulinFragment extends Fragment {
} }
private void updateGUI() { private void updateGUI() {
insulinName.setText(ConfigBuilderPlugin.getActiveInsulin().getFriendlyName()); insulinName.setText(ConfigBuilderPlugin.getPlugin().getActiveInsulin().getFriendlyName());
insulinComment.setText(ConfigBuilderPlugin.getActiveInsulin().getComment()); insulinComment.setText(ConfigBuilderPlugin.getPlugin().getActiveInsulin().getComment());
insulinDia.setText(MainApp.gs(R.string.dia) + " " + Double.toString(ConfigBuilderPlugin.getActiveInsulin().getDia()) + "h"); insulinDia.setText(MainApp.gs(R.string.dia) + " " + Double.toString(ConfigBuilderPlugin.getPlugin().getActiveInsulin().getDia()) + "h");
insulinGraph.show(ConfigBuilderPlugin.getActiveInsulin()); insulinGraph.show(ConfigBuilderPlugin.getPlugin().getActiveInsulin());
} }
} }

View file

@ -242,7 +242,7 @@ public class Treatment implements DataPointWithLabelInterface {
if (!isValid) if (!isValid)
return new Iob(); return new Iob();
InsulinInterface insulinInterface = ConfigBuilderPlugin.getActiveInsulin(); InsulinInterface insulinInterface = ConfigBuilderPlugin.getPlugin().getActiveInsulin();
return insulinInterface.iobCalcForTreatment(this, time, dia); return insulinInterface.iobCalcForTreatment(this, time, dia);
} }
} }