diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Actions/ActionsFragment.java b/app/src/main/java/info/nightscout/androidaps/plugins/Actions/ActionsFragment.java index 7f865dc591..7eb8a7f960 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Actions/ActionsFragment.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Actions/ActionsFragment.java @@ -22,6 +22,7 @@ import info.nightscout.androidaps.plugins.Actions.dialogs.NewExtendedBolusDialog import info.nightscout.androidaps.plugins.Actions.dialogs.NewTempBasalDialog; import info.nightscout.androidaps.plugins.Careportal.Dialogs.NewNSTreatmentDialog; import info.nightscout.androidaps.plugins.Careportal.OptionsToShow; +import info.nightscout.androidaps.plugins.PumpDanaRv2.DanaRv2Plugin; /** * A simple {@link Fragment} subclass. @@ -152,8 +153,12 @@ public class ActionsFragment extends Fragment implements View.OnClickListener { fillDialog.show(manager, "FillDialog"); break; case R.id.actions_50_30: + DanaRv2Plugin danaRv2Plugin = (DanaRv2Plugin) MainApp.getSpecificPlugin(DanaRv2Plugin.class); + danaRv2Plugin.setHighTempBasalPercent(50); break; case R.id.actions_400_15: + danaRv2Plugin = (DanaRv2Plugin) MainApp.getSpecificPlugin(DanaRv2Plugin.class); + danaRv2Plugin.setHighTempBasalPercent(400); break; } } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRv2/comm/MsgHistoryEvents.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRv2/comm/MsgHistoryEvents.java index ea3a9e2fee..cad1d827b1 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRv2/comm/MsgHistoryEvents.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRv2/comm/MsgHistoryEvents.java @@ -85,6 +85,9 @@ public class MsgHistoryEvents extends MessageBase { case 13: log.debug("EVENT PROFILECHANGE (" + recordCode + ") " + DateUtil.dateAndTimeString(datetime) + " No: " + param1 + "U CurrentRate: " + param2 + "U/h"); break; + case 14: + log.debug("EVENT CARBS (" + recordCode + ") " + DateUtil.dateAndTimeString(datetime) + " Carbs: " + param1 + "g"); + break; default: log.debug("Event: " + recordCode + " " + DateUtil.dateAndTimeString(datetime) + " Param1: " + param1 + " Param2: " + param2); break; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRv2/comm/MsgSetAPSTempBasalStart.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRv2/comm/MsgSetAPSTempBasalStart.java index e366f76441..f62296887e 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRv2/comm/MsgSetAPSTempBasalStart.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRv2/comm/MsgSetAPSTempBasalStart.java @@ -21,9 +21,16 @@ public class MsgSetAPSTempBasalStart extends MessageBase { if (percent > 500) percent = 500; AddParamInt(percent); + if (percent < 100) { + AddParamByte((byte) 0xA0); // 160 + if (Config.logDanaMessageDetail) + log.debug("APS Temp basal start percent: " + percent + " duration 30 min"); + } else { + AddParamByte((byte) 0x96); // 150 + if (Config.logDanaMessageDetail) + log.debug("APS Temp basal start percent: " + percent + " duration 15 min"); + } - if (Config.logDanaMessageDetail) - log.debug("APS Temp basal start percent: " + percent + " duration 15 min"); } public void handleMessage(byte[] bytes) { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRv2/comm/MsgStatusAPSTempBasal.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRv2/comm/MsgStatusAPSTempBasal.java index 40e8b2f7d8..ec9b191661 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRv2/comm/MsgStatusAPSTempBasal.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRv2/comm/MsgStatusAPSTempBasal.java @@ -16,17 +16,13 @@ public class MsgStatusAPSTempBasal extends MessageBase { public void handleMessage(byte[] bytes) { double iob = intFromBuff(bytes, 0, 2) / 100d; - int tempBasalPercent = intFromBuff(bytes, 2, 2); + double deliveredSoFar = intFromBuff(bytes, 2, 2) / 100d; DanaRPump pump = DanaRPump.getInstance(); - pump.isTempBasalInProgress = tempBasalPercent != 100; - pump.tempBasalPercent = tempBasalPercent; pump.iob = iob; - if (Config.logDanaMessageDetail) { - log.debug("Is APS temp basal running: " + pump.isTempBasalInProgress); - log.debug("Current APS temp basal percent: " + tempBasalPercent); + log.debug("Delivered so far: " + deliveredSoFar); log.debug("Current pump IOB: " + iob); } }