From a64364de4e1f6ad3b73ba56089676db60ab8af6a Mon Sep 17 00:00:00 2001 From: PoweRGbg Date: Wed, 13 Jun 2018 16:17:10 +0300 Subject: [PATCH] removed excessive debugging and unneeded source --- .../activities/DanaRUserOptionsActivity.java | 8 +++++ .../PumpDanaR/comm/MsgSetUserOptions.java | 35 ------------------- .../PumpDanaR/comm/MsgSettingUserOptions.java | 8 ++--- 3 files changed, 11 insertions(+), 40 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/activities/DanaRUserOptionsActivity.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/activities/DanaRUserOptionsActivity.java index 4a670a7e81..571f1a20e1 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/activities/DanaRUserOptionsActivity.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/activities/DanaRUserOptionsActivity.java @@ -153,6 +153,14 @@ public class DanaRUserOptionsActivity extends Activity { pump.buttonScrollOnOff = 1; else pump.buttonScrollOnOff = 0; + + pump.beepAndAlarm = 1; // default + if (pumpAlarmSound.isChecked()) pump.beepAndAlarm = 1; + else if (pumpAlarmVibrate.isChecked()) pump.beepAndAlarm = 2; + else if (pumpAlarmBoth.isChecked()) pump.beepAndAlarm = 3; + if (beep.isChecked()) pump.beepAndAlarm += 4; + + // step is 5 seconds int screenTimeoutValue = !screenTimeout.getText().isEmpty() ? (Integer.parseInt(screenTimeout.getText().toString()) / 5) * 5: 5; if (screenTimeoutValue > 4 && screenTimeoutValue < 241) { 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 dfb35ebee3..5c5d9c1507 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 @@ -16,40 +16,6 @@ public class MsgSetUserOptions extends MessageBase { 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) { - this(); - DanaRPump pump = DanaRPump.getInstance(); - if (pump.userOptionsFrompump.length == 0) { - // No options set -> Exitting - log.debug("NO USER OPTIONS LOADED EXITTING!"); - return; - } - - log.debug(" initializing MsgSetUserOptions"); - log.debug("timeDisplayType: " + (byte) timeDisplayType); - log.debug("Button scroll: " + (byte) buttonScrollOnOff); - log.debug("BeepAndAlarm: " + (byte) beepAndAlarm); - log.debug("screen timeout: " + (byte) lcdOnTimeSec); - log.debug("Backlight: " + (byte) backlightOnTimeSec); - log.debug("Selected language: " + (byte) selectedLanguage); - log.debug("Units: " + (byte) glucoseUnit); - log.debug("Shutdown: " + (byte) shutdownHour); - log.debug("Low reservoir: " + (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