From 4581733cd782b5c7ef47cacf13f73bf6143e1c24 Mon Sep 17 00:00:00 2001 From: Roumen Georgiev Date: Fri, 1 Jun 2018 11:41:37 +0300 Subject: [PATCH] some debugging output and forced getting user options --- .../PumpDanaR/activities/DanaRUserOptionsActivity.java | 10 ++++++++++ .../comm/DanaRS_Packet_Option_Get_User_Option.java | 2 +- .../plugins/PumpDanaRS/services/DanaRSService.java | 2 ++ 3 files changed, 13 insertions(+), 1 deletion(-) 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 62a2166e7a..ee59ca33a8 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 @@ -95,6 +95,16 @@ public class DanaRUserOptionsActivity extends Activity { @Override public void run() { DanaRPump pump = DanaRPump.getInstance(); + //used for debugging + log.debug("UserOptionsLoadedd:"+(System.currentTimeMillis() - pump.lastConnection)/1000+" s ago" + +"\ntimeDisplayType:"+pump.timeDisplayType + +"\nbuttonScroll:"+pump.buttonScrollOnOff + +"\ntimeDisplayType:"+pump.timeDisplayType + +"\nlcdOnTimeSec:"+pump.lcdOnTimeSec + +"\nbacklight:"+pump.backlightOnTimeSec + +"\npumpUnits:"+pump.units + +"\nlowReservoir:"+pump.lowReservoirRate); + if (pump.timeDisplayType != 0) { timeFormat.setChecked(true); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRS/comm/DanaRS_Packet_Option_Get_User_Option.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRS/comm/DanaRS_Packet_Option_Get_User_Option.java index b4df373f9c..0332e7352b 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRS/comm/DanaRS_Packet_Option_Get_User_Option.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRS/comm/DanaRS_Packet_Option_Get_User_Option.java @@ -87,7 +87,7 @@ public class DanaRS_Packet_Option_Get_User_Option extends DanaRS_Packet { dataSize = 1; int selectableLanguage5 = byteArrayToInt(getBytes(data, dataIndex, dataSize)); - if (Config.logDanaMessageDetail) { + if (true) { log.debug("timeDisplayType: " + pump.timeDisplayType); log.debug("buttonScrollOnOff: " + pump.buttonScrollOnOff); log.debug("beepAndAlarm: " + pump.beepAndAlarm); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRS/services/DanaRSService.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRS/services/DanaRSService.java index 856b95492d..f30be97d91 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRS/services/DanaRSService.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRS/services/DanaRSService.java @@ -19,6 +19,7 @@ import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.R; import info.nightscout.androidaps.data.Profile; import info.nightscout.androidaps.data.PumpEnactResult; +import info.nightscout.androidaps.plugins.PumpDanaRS.comm.DanaRS_Packet_Option_Get_User_Option; import info.nightscout.androidaps.plugins.Treatments.Treatment; import info.nightscout.androidaps.events.EventAppExit; import info.nightscout.androidaps.events.EventInitializationChanged; @@ -146,6 +147,7 @@ public class DanaRSService extends Service { bleComm.sendMessage(new DanaRS_Packet_Bolus_Get_CIR_CF_Array()); MainApp.bus().post(new EventPumpStatusChanged(MainApp.gs(R.string.gettingpumptime))); bleComm.sendMessage(new DanaRS_Packet_Option_Get_Pump_Time()); + bleComm.sendMessage(new DanaRS_Packet_Option_Get_User_Option()); // Getting user options long timeDiff = (danaRPump.pumpTime.getTime() - System.currentTimeMillis()) / 1000L; log.debug("Pump time difference: " + timeDiff + " seconds"); if (Math.abs(timeDiff) > 3) {