use helper class to query settings

This commit is contained in:
AdrianLxM 2017-05-10 16:33:41 +02:00
parent fc85deb62d
commit b247b81428
2 changed files with 3 additions and 2 deletions

View file

@ -246,7 +246,7 @@ public class DetermineBasalAdapterAMAJS {
mGlucoseStatus = new V8Object(mV8rt); mGlucoseStatus = new V8Object(mV8rt);
mGlucoseStatus.add("glucose", glucoseStatus.glucose); mGlucoseStatus.add("glucose", glucoseStatus.glucose);
if(PreferenceManager.getDefaultSharedPreferences(MainApp.instance()).getBoolean("always_use_shortavg", false)){ if(SP.getBoolean("always_use_shortavg", false)){
mGlucoseStatus.add("delta", glucoseStatus.short_avgdelta); mGlucoseStatus.add("delta", glucoseStatus.short_avgdelta);
} else { } else {
mGlucoseStatus.add("delta", glucoseStatus.delta); mGlucoseStatus.add("delta", glucoseStatus.delta);

View file

@ -22,6 +22,7 @@ import info.nightscout.androidaps.data.MealData;
import info.nightscout.androidaps.interfaces.PumpInterface; import info.nightscout.androidaps.interfaces.PumpInterface;
import info.nightscout.androidaps.plugins.Loop.ScriptReader; import info.nightscout.androidaps.plugins.Loop.ScriptReader;
import info.nightscout.androidaps.plugins.NSClientInternal.data.NSProfile; import info.nightscout.androidaps.plugins.NSClientInternal.data.NSProfile;
import info.nightscout.utils.SP;
public class DetermineBasalAdapterMAJS { public class DetermineBasalAdapterMAJS {
private static Logger log = LoggerFactory.getLogger(DetermineBasalAdapterMAJS.class); private static Logger log = LoggerFactory.getLogger(DetermineBasalAdapterMAJS.class);
@ -254,7 +255,7 @@ public class DetermineBasalAdapterMAJS {
mIobData.add("hightempinsulin", iobData.hightempinsulin); mIobData.add("hightempinsulin", iobData.hightempinsulin);
mGlucoseStatus.add("glucose", glucoseStatus.glucose); mGlucoseStatus.add("glucose", glucoseStatus.glucose);
if(PreferenceManager.getDefaultSharedPreferences(MainApp.instance()).getBoolean("always_use_shortavg", false)){ if(SP.getBoolean("always_use_shortavg", false)){
mGlucoseStatus.add("delta", glucoseStatus.short_avgdelta); mGlucoseStatus.add("delta", glucoseStatus.short_avgdelta);
} else { } else {
mGlucoseStatus.add("delta", glucoseStatus.delta); mGlucoseStatus.add("delta", glucoseStatus.delta);