removed excessive debugging and unneeded source

This commit is contained in:
PoweRGbg 2018-06-13 16:17:10 +03:00
parent 5a197676fb
commit a64364de4e
3 changed files with 11 additions and 40 deletions

View file

@ -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) {

View file

@ -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<pump.userOptionsFrompump.length; i++){
// AddParamByte(pump.userOptionsFrompump[i]);
log.debug("rgDebug:userOptions["+i+"]="+pump.userOptionsFrompump[i]);
}
}
public MsgSetUserOptions() {
SetCommand(0x330B);
DanaRPump pump = DanaRPump.getInstance();
@ -69,7 +35,6 @@ public class MsgSetUserOptions extends MessageBase {
pump.userOptionsFrompump[27] = (byte) pump.lowReservoirRate;
for(int i=0; i<pump.userOptionsFrompump.length; i++){
AddParamByte(pump.userOptionsFrompump[i]);
log.debug("rgDebug:userOptions["+i+"]="+pump.userOptionsFrompump[i]);
}
}

View file

@ -5,6 +5,7 @@ import org.slf4j.LoggerFactory;
import java.util.Arrays;
import info.nightscout.androidaps.Config;
import info.nightscout.androidaps.plugins.PumpDanaR.DanaRPump;
/**
@ -41,11 +42,8 @@ public class MsgSettingUserOptions extends MessageBase {
int selectableLanguage4 = bytes[13];
int selectableLanguage5 = bytes[14];
*/
for(int i=0; i<pump.userOptionsFrompump.length; i++){
log.debug("rgDebug:userOptions["+i+"]="+pump.userOptionsFrompump[i]);
}
// if (Config.logDanaMessageDetail) {
if (Config.logDanaMessageDetail) {
log.debug("timeDisplayType: " + pump.timeDisplayType);
log.debug("Button scroll: " + pump.buttonScrollOnOff);
@ -56,7 +54,7 @@ public class MsgSettingUserOptions extends MessageBase {
log.debug("Units: " + pump.getUnits());
log.debug("Shutdown: " + pump.shutdownHour);
log.debug("Low reservoir: " + pump.lowReservoirRate);
// }
}
}
public static byte[] getDataBytes(byte[] bytes, int start, int len) {