upload AMA result to NS too

This commit is contained in:
Milos Kozak 2017-01-03 21:42:32 +01:00
parent 05911be4e0
commit 50f75e3404

View file

@ -43,6 +43,7 @@ import info.nightscout.androidaps.plugins.DanaR.comm.MsgError;
import info.nightscout.androidaps.plugins.Loop.APSResult; import info.nightscout.androidaps.plugins.Loop.APSResult;
import info.nightscout.androidaps.plugins.Loop.DeviceStatus; import info.nightscout.androidaps.plugins.Loop.DeviceStatus;
import info.nightscout.androidaps.plugins.Loop.LoopPlugin; import info.nightscout.androidaps.plugins.Loop.LoopPlugin;
import info.nightscout.androidaps.plugins.OpenAPSAMA.DetermineBasalResultAMA;
import info.nightscout.androidaps.plugins.OpenAPSMA.DetermineBasalResultMA; import info.nightscout.androidaps.plugins.OpenAPSMA.DetermineBasalResultMA;
import info.nightscout.androidaps.plugins.Overview.Dialogs.BolusProgressDialog; import info.nightscout.androidaps.plugins.Overview.Dialogs.BolusProgressDialog;
import info.nightscout.androidaps.plugins.Actions.dialogs.NewExtendedBolusDialog; import info.nightscout.androidaps.plugins.Actions.dialogs.NewExtendedBolusDialog;
@ -906,6 +907,12 @@ public class ConfigBuilderPlugin implements PluginBase, PumpInterface, Constrain
deviceStatus.iob.put("time", DateUtil.toISOString(lastRun.lastAPSRun)); deviceStatus.iob.put("time", DateUtil.toISOString(lastRun.lastAPSRun));
} }
if (lastRun.request instanceof DetermineBasalResultAMA) {
DetermineBasalResultAMA result = (DetermineBasalResultAMA) lastRun.request;
deviceStatus.iob = result.iob.json();
deviceStatus.iob.put("time", DateUtil.toISOString(lastRun.lastAPSRun));
}
if (lastRun.setByPump != null && lastRun.setByPump.enacted) { // enacted if (lastRun.setByPump != null && lastRun.setByPump.enacted) { // enacted
deviceStatus.enacted = lastRun.request.json(); deviceStatus.enacted = lastRun.request.json();
deviceStatus.enacted.put("rate", lastRun.setByPump.json().get("rate")); deviceStatus.enacted.put("rate", lastRun.setByPump.json().get("rate"));