From 5a197676fb289f2399af9de897fe3c622edf048b Mon Sep 17 00:00:00 2001 From: PoweRGbg Date: Wed, 13 Jun 2018 15:57:42 +0300 Subject: [PATCH] IT WORKS!!! --- .../PumpDanaR/comm/MsgSetUserOptions.java | 65 +++++++++---------- .../PumpDanaR/comm/MsgSettingUserOptions.java | 3 + 2 files changed, 33 insertions(+), 35 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/comm/MsgSetUserOptions.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/comm/MsgSetUserOptions.java index 2b19936b10..dfb35ebee3 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/comm/MsgSetUserOptions.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/comm/MsgSetUserOptions.java @@ -14,19 +14,6 @@ public class MsgSetUserOptions extends MessageBase { private static Logger log = LoggerFactory.getLogger(MsgSetUserOptions.class); - private int backlightOnTimeSec; - private int beepAndAlarm; - private int buttonScrollOnOff; - private int cannulaVolume; - private int error; - private int glucoseUnit; - private int lcdOnTimeSec; - private int lowReservoirRate; - private int refillRate; - private int selectedLanguage; - private int shutdownHour; - private int timeDisplayType; - byte[] newOptions; public boolean done; public MsgSetUserOptions(int timeDisplayType, int buttonScrollOnOff, int beepAndAlarm, int lcdOnTimeSec, int backlightOnTimeSec, int selectedLanguage, int glucoseUnit, int shutdownHour, int lowReservoirRate, int cannulaVolume, int refillRate) { @@ -48,37 +35,45 @@ public class MsgSetUserOptions extends MessageBase { log.debug("Units: " + (byte) glucoseUnit); log.debug("Shutdown: " + (byte) shutdownHour); log.debug("Low reservoir: " + (byte) lowReservoirRate); - this.timeDisplayType = timeDisplayType; - this.buttonScrollOnOff = buttonScrollOnOff; - this.beepAndAlarm = beepAndAlarm; - this.lcdOnTimeSec = lcdOnTimeSec; - this.backlightOnTimeSec = backlightOnTimeSec; - this.selectedLanguage = selectedLanguage; - this.glucoseUnit = glucoseUnit; - this.shutdownHour = shutdownHour; - this.lowReservoirRate = lowReservoirRate; - this.cannulaVolume = cannulaVolume; - this.refillRate = refillRate; - pump.userOptionsFrompump[0] = (byte) (timeDisplayType == 1 ? 0 : 1); - pump.userOptionsFrompump[1] = (byte) buttonScrollOnOff; - pump.userOptionsFrompump[2] = (byte) beepAndAlarm; - pump.userOptionsFrompump[3] = (byte) lcdOnTimeSec; - pump.userOptionsFrompump[4] = (byte) backlightOnTimeSec; - pump.userOptionsFrompump[5] = (byte) selectedLanguage; - pump.userOptionsFrompump[8] = (byte) glucoseUnit; - pump.userOptionsFrompump[9] = (byte) shutdownHour; - pump.userOptionsFrompump[27] = (byte) lowReservoirRate; + pump.userOptionsFrompump[0] = (byte) (pump.timeDisplayType == 1 ? 0 : 1); + pump.userOptionsFrompump[1] = (byte) pump.buttonScrollOnOff; + pump.userOptionsFrompump[2] = (byte) pump.beepAndAlarm; + pump.userOptionsFrompump[3] = (byte) pump.lcdOnTimeSec; + pump.userOptionsFrompump[4] = (byte) pump.backlightOnTimeSec; + pump.userOptionsFrompump[5] = (byte) pump.selectedLanguage; + pump.userOptionsFrompump[8] = (byte) pump.units; + pump.userOptionsFrompump[9] = (byte) pump.shutdownHour; + pump.userOptionsFrompump[27] = (byte) pump.lowReservoirRate; for(int i=0; i