Merge pull request #233 from AdrianLxM/xdripstatusline
move evaluation of always_use_shortavg setting to the OAPS plugins
This commit is contained in:
commit
7ff7aafc09
|
@ -131,7 +131,7 @@ public class GlucoseStatus {
|
|||
|
||||
status.short_avgdelta = average(short_deltas);
|
||||
|
||||
if (prefs.getBoolean("always_use_shortavg", false) || last_deltas.isEmpty()) {
|
||||
if (last_deltas.isEmpty()) {
|
||||
status.delta = status.short_avgdelta;
|
||||
} else {
|
||||
status.delta = average(last_deltas);
|
||||
|
|
|
@ -243,7 +243,12 @@ public class DetermineBasalAdapterAMAJS {
|
|||
|
||||
mGlucoseStatus = new V8Object(mV8rt);
|
||||
mGlucoseStatus.add("glucose", glucoseStatus.glucose);
|
||||
mGlucoseStatus.add("delta", glucoseStatus.delta);
|
||||
|
||||
if(SP.getBoolean("always_use_shortavg", false)){
|
||||
mGlucoseStatus.add("delta", glucoseStatus.short_avgdelta);
|
||||
} else {
|
||||
mGlucoseStatus.add("delta", glucoseStatus.delta);
|
||||
}
|
||||
mGlucoseStatus.add("short_avgdelta", glucoseStatus.short_avgdelta);
|
||||
mGlucoseStatus.add("long_avgdelta", glucoseStatus.long_avgdelta);
|
||||
mV8rt.add(PARAM_glucoseStatus, mGlucoseStatus);
|
||||
|
|
|
@ -19,6 +19,7 @@ import info.nightscout.androidaps.data.MealData;
|
|||
import info.nightscout.androidaps.interfaces.PumpInterface;
|
||||
import info.nightscout.androidaps.plugins.Loop.ScriptReader;
|
||||
import info.nightscout.androidaps.plugins.NSClientInternal.data.NSProfile;
|
||||
import info.nightscout.utils.SP;
|
||||
|
||||
public class DetermineBasalAdapterMAJS {
|
||||
private static Logger log = LoggerFactory.getLogger(DetermineBasalAdapterMAJS.class);
|
||||
|
@ -251,7 +252,11 @@ public class DetermineBasalAdapterMAJS {
|
|||
mIobData.add("hightempinsulin", iobData.hightempinsulin);
|
||||
|
||||
mGlucoseStatus.add("glucose", glucoseStatus.glucose);
|
||||
mGlucoseStatus.add("delta", glucoseStatus.delta);
|
||||
if(SP.getBoolean("always_use_shortavg", false)){
|
||||
mGlucoseStatus.add("delta", glucoseStatus.short_avgdelta);
|
||||
} else {
|
||||
mGlucoseStatus.add("delta", glucoseStatus.delta);
|
||||
}
|
||||
mGlucoseStatus.add("avgdelta", glucoseStatus.avgdelta);
|
||||
|
||||
mMealData.add("carbs", mealData.carbs);
|
||||
|
|
Loading…
Reference in a new issue