- some minor changes on dependency (removed full path)

- removed some logging
- fixed DailyTotalsDTO toString
- changed level of some logging
This commit is contained in:
Andy Rozman 2020-07-18 15:18:25 +01:00
parent 6e50c3651d
commit 23cd1d9143
14 changed files with 97 additions and 83 deletions

View file

@ -26,7 +26,7 @@ abstract class ActivitiesModule {
@ContributesAndroidInjector abstract fun contributesInsightPairingInformationActivity(): InsightPairingInformationActivity @ContributesAndroidInjector abstract fun contributesInsightPairingInformationActivity(): InsightPairingInformationActivity
@ContributesAndroidInjector abstract fun contributesLogSettingActivity(): LogSettingActivity @ContributesAndroidInjector abstract fun contributesLogSettingActivity(): LogSettingActivity
@ContributesAndroidInjector abstract fun contributeMainActivity(): MainActivity @ContributesAndroidInjector abstract fun contributeMainActivity(): MainActivity
@ContributesAndroidInjector abstract fun contributesMedtronicHistoryActivity(): info.nightscout.androidaps.plugins.pump.medtronic.dialog.MedtronicHistoryActivity @ContributesAndroidInjector abstract fun contributesMedtronicHistoryActivity(): MedtronicHistoryActivity
@ContributesAndroidInjector abstract fun contributesPreferencesActivity(): PreferencesActivity @ContributesAndroidInjector abstract fun contributesPreferencesActivity(): PreferencesActivity
@ContributesAndroidInjector abstract fun contributesQuickWizardListActivity(): QuickWizardListActivity @ContributesAndroidInjector abstract fun contributesQuickWizardListActivity(): QuickWizardListActivity
@ContributesAndroidInjector abstract fun contributesRequestDexcomPermissionActivity(): RequestDexcomPermissionActivity @ContributesAndroidInjector abstract fun contributesRequestDexcomPermissionActivity(): RequestDexcomPermissionActivity

View file

@ -29,6 +29,8 @@ import info.nightscout.androidaps.plugins.insulin.InsulinFragment
import info.nightscout.androidaps.plugins.profile.local.LocalProfileFragment import info.nightscout.androidaps.plugins.profile.local.LocalProfileFragment
import info.nightscout.androidaps.plugins.profile.ns.NSProfileFragment import info.nightscout.androidaps.plugins.profile.ns.NSProfileFragment
import info.nightscout.androidaps.plugins.pump.combo.ComboFragment import info.nightscout.androidaps.plugins.pump.combo.ComboFragment
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.dialog.RileyLinkStatusGeneralFragment
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.dialog.RileyLinkStatusHistoryFragment
import info.nightscout.androidaps.plugins.pump.insight.LocalInsightFragment import info.nightscout.androidaps.plugins.pump.insight.LocalInsightFragment
import info.nightscout.androidaps.plugins.pump.medtronic.MedtronicFragment import info.nightscout.androidaps.plugins.pump.medtronic.MedtronicFragment
import info.nightscout.androidaps.plugins.pump.medtronic.dialog.RileyLinkStatusDeviceMedtronic import info.nightscout.androidaps.plugins.pump.medtronic.dialog.RileyLinkStatusDeviceMedtronic
@ -63,7 +65,7 @@ abstract class FragmentsModule {
@ContributesAndroidInjector abstract fun contributesLocalInsightFragment(): LocalInsightFragment @ContributesAndroidInjector abstract fun contributesLocalInsightFragment(): LocalInsightFragment
@ContributesAndroidInjector abstract fun contributesLoopFragment(): LoopFragment @ContributesAndroidInjector abstract fun contributesLoopFragment(): LoopFragment
@ContributesAndroidInjector abstract fun contributesMaintenanceFragment(): MaintenanceFragment @ContributesAndroidInjector abstract fun contributesMaintenanceFragment(): MaintenanceFragment
@ContributesAndroidInjector abstract fun contributesMedtronicFragment(): info.nightscout.androidaps.plugins.pump.medtronic.MedtronicFragment @ContributesAndroidInjector abstract fun contributesMedtronicFragment(): MedtronicFragment
@ContributesAndroidInjector abstract fun contributesOmnipodFragment(): OmnipodFragment @ContributesAndroidInjector abstract fun contributesOmnipodFragment(): OmnipodFragment
@ContributesAndroidInjector abstract fun contributesNSProfileFragment(): NSProfileFragment @ContributesAndroidInjector abstract fun contributesNSProfileFragment(): NSProfileFragment
@ContributesAndroidInjector abstract fun contributesNSClientFragment(): NSClientFragment @ContributesAndroidInjector abstract fun contributesNSClientFragment(): NSClientFragment
@ -106,7 +108,7 @@ abstract class FragmentsModule {
@ContributesAndroidInjector abstract fun contributesPasswordCheck(): PasswordCheck @ContributesAndroidInjector abstract fun contributesPasswordCheck(): PasswordCheck
@ContributesAndroidInjector abstract fun contributesRileyLinkStatusGeneral(): info.nightscout.androidaps.plugins.pump.common.hw.rileylink.dialog.RileyLinkStatusGeneralFragment @ContributesAndroidInjector abstract fun contributesRileyLinkStatusGeneral(): RileyLinkStatusGeneralFragment
@ContributesAndroidInjector abstract fun contributesRileyLinkStatusHistoryFragment(): info.nightscout.androidaps.plugins.pump.common.hw.rileylink.dialog.RileyLinkStatusHistoryFragment @ContributesAndroidInjector abstract fun contributesRileyLinkStatusHistoryFragment(): RileyLinkStatusHistoryFragment
@ContributesAndroidInjector abstract fun contributesRileyLinkStatusDeviceMedtronic(): info.nightscout.androidaps.plugins.pump.medtronic.dialog.RileyLinkStatusDeviceMedtronic @ContributesAndroidInjector abstract fun contributesRileyLinkStatusDeviceMedtronic(): RileyLinkStatusDeviceMedtronic
} }

View file

@ -2,25 +2,33 @@ package info.nightscout.androidaps.dependencyInjection
import dagger.Module import dagger.Module
import dagger.android.ContributesAndroidInjector import dagger.android.ContributesAndroidInjector
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkCommunicationManager
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.RFSpy
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.RileyLinkBLE
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.command.SendAndListen
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.command.SetPreamble
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.data.RadioPacket
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.data.RadioResponse
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.tasks.*
import info.nightscout.androidaps.plugins.pump.medtronic.comm.MedtronicCommunicationManager import info.nightscout.androidaps.plugins.pump.medtronic.comm.MedtronicCommunicationManager
import info.nightscout.androidaps.plugins.pump.medtronic.comm.ui.MedtronicUITask import info.nightscout.androidaps.plugins.pump.medtronic.comm.ui.MedtronicUITask
@Module @Module
@Suppress("unused") @Suppress("unused")
abstract class MedtronicModule { abstract class MedtronicModule {
@ContributesAndroidInjector abstract fun rileyLinkCommunicationManagerProvider(): info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkCommunicationManager @ContributesAndroidInjector abstract fun rileyLinkCommunicationManagerProvider(): RileyLinkCommunicationManager
@ContributesAndroidInjector abstract fun medtronicCommunicationManagerProvider(): info.nightscout.androidaps.plugins.pump.medtronic.comm.MedtronicCommunicationManager @ContributesAndroidInjector abstract fun medtronicCommunicationManagerProvider(): MedtronicCommunicationManager
@ContributesAndroidInjector abstract fun medtronicUITaskProvider(): info.nightscout.androidaps.plugins.pump.medtronic.comm.ui.MedtronicUITask @ContributesAndroidInjector abstract fun medtronicUITaskProvider(): MedtronicUITask
@ContributesAndroidInjector abstract fun serviceTaskProvider(): info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.tasks.ServiceTask @ContributesAndroidInjector abstract fun serviceTaskProvider(): ServiceTask
@ContributesAndroidInjector abstract fun pumpTaskProvider(): info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.tasks.PumpTask @ContributesAndroidInjector abstract fun pumpTaskProvider(): PumpTask
@ContributesAndroidInjector abstract fun discoverGattServicesTaskProvider(): info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.tasks.DiscoverGattServicesTask @ContributesAndroidInjector abstract fun discoverGattServicesTaskProvider(): DiscoverGattServicesTask
@ContributesAndroidInjector abstract fun initializePumpManagerTaskProvider(): info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.tasks.InitializePumpManagerTask @ContributesAndroidInjector abstract fun initializePumpManagerTaskProvider(): InitializePumpManagerTask
@ContributesAndroidInjector abstract fun resetRileyLinkConfigurationTaskProvider(): info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.tasks.ResetRileyLinkConfigurationTask @ContributesAndroidInjector abstract fun resetRileyLinkConfigurationTaskProvider(): ResetRileyLinkConfigurationTask
@ContributesAndroidInjector abstract fun wakeAndTuneTaskProvider(): info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.tasks.WakeAndTuneTask @ContributesAndroidInjector abstract fun wakeAndTuneTaskProvider(): WakeAndTuneTask
@ContributesAndroidInjector abstract fun radioResponseProvider(): info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.data.RadioResponse @ContributesAndroidInjector abstract fun radioResponseProvider(): RadioResponse
@ContributesAndroidInjector abstract fun rileyLinkBLEProvider(): info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.RileyLinkBLE @ContributesAndroidInjector abstract fun rileyLinkBLEProvider(): RileyLinkBLE
@ContributesAndroidInjector abstract fun rfSpyProvider(): info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.RFSpy @ContributesAndroidInjector abstract fun rfSpyProvider(): RFSpy
@ContributesAndroidInjector abstract fun sendAndListenProvider(): info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.command.SendAndListen @ContributesAndroidInjector abstract fun sendAndListenProvider(): SendAndListen
@ContributesAndroidInjector abstract fun setPreambleProvider(): info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.command.SetPreamble @ContributesAndroidInjector abstract fun setPreambleProvider(): SetPreamble
@ContributesAndroidInjector abstract fun radioPacketProvider(): info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.data.RadioPacket @ContributesAndroidInjector abstract fun radioPacketProvider(): RadioPacket
} }

View file

@ -145,7 +145,7 @@ abstract class PluginsModule {
@PumpDriver @PumpDriver
@IntoMap @IntoMap
@IntKey(150) @IntKey(150)
abstract fun bindMedtronicPumpPlugin(plugin: info.nightscout.androidaps.plugins.pump.medtronic.MedtronicPumpPlugin): PluginBase abstract fun bindMedtronicPumpPlugin(plugin: MedtronicPumpPlugin): PluginBase
@Binds @Binds
@NotNSClient @NotNSClient

View file

@ -16,9 +16,9 @@ abstract class ReceiversModule {
@ContributesAndroidInjector abstract fun contributesChargingStateReceiver(): ChargingStateReceiver @ContributesAndroidInjector abstract fun contributesChargingStateReceiver(): ChargingStateReceiver
@ContributesAndroidInjector abstract fun contributesDataReceiver(): DataReceiver @ContributesAndroidInjector abstract fun contributesDataReceiver(): DataReceiver
@ContributesAndroidInjector abstract fun contributesKeepAliveReceiver(): KeepAliveReceiver @ContributesAndroidInjector abstract fun contributesKeepAliveReceiver(): KeepAliveReceiver
@ContributesAndroidInjector abstract fun contributesRileyLinkBluetoothStateReceiver(): info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.RileyLinkBluetoothStateReceiver @ContributesAndroidInjector abstract fun contributesRileyLinkBluetoothStateReceiver(): RileyLinkBluetoothStateReceiver
@ContributesAndroidInjector abstract fun contributesSmsReceiver(): SmsReceiver @ContributesAndroidInjector abstract fun contributesSmsReceiver(): SmsReceiver
@ContributesAndroidInjector abstract fun contributesTimeDateOrTZChangeReceiver(): TimeDateOrTZChangeReceiver @ContributesAndroidInjector abstract fun contributesTimeDateOrTZChangeReceiver(): TimeDateOrTZChangeReceiver
@ContributesAndroidInjector abstract fun contributesCarbSuggestionReceiver(): CarbSuggestionReceiver @ContributesAndroidInjector abstract fun contributesCarbSuggestionReceiver(): CarbSuggestionReceiver
@ContributesAndroidInjector abstract fun contributesRileyLinkBroadcastReceiver(): info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.RileyLinkBroadcastReceiver @ContributesAndroidInjector abstract fun contributesRileyLinkBroadcastReceiver(): RileyLinkBroadcastReceiver
} }

View file

@ -6,6 +6,7 @@ import info.nightscout.androidaps.plugins.general.nsclient.services.NSClientServ
import info.nightscout.androidaps.plugins.general.overview.notifications.DismissNotificationService import info.nightscout.androidaps.plugins.general.overview.notifications.DismissNotificationService
import info.nightscout.androidaps.plugins.general.persistentNotification.DummyService import info.nightscout.androidaps.plugins.general.persistentNotification.DummyService
import info.nightscout.androidaps.plugins.general.wear.wearintegration.WatchUpdaterService import info.nightscout.androidaps.plugins.general.wear.wearintegration.WatchUpdaterService
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.RileyLinkService
import info.nightscout.androidaps.plugins.pump.insight.InsightAlertService import info.nightscout.androidaps.plugins.pump.insight.InsightAlertService
import info.nightscout.androidaps.plugins.pump.insight.connection_service.InsightConnectionService import info.nightscout.androidaps.plugins.pump.insight.connection_service.InsightConnectionService
import info.nightscout.androidaps.plugins.pump.medtronic.service.RileyLinkMedtronicService import info.nightscout.androidaps.plugins.pump.medtronic.service.RileyLinkMedtronicService
@ -27,7 +28,7 @@ abstract class ServicesModule {
@ContributesAndroidInjector abstract fun contributesWatchUpdaterService(): WatchUpdaterService @ContributesAndroidInjector abstract fun contributesWatchUpdaterService(): WatchUpdaterService
@ContributesAndroidInjector abstract fun contributesInsightAlertService(): InsightAlertService @ContributesAndroidInjector abstract fun contributesInsightAlertService(): InsightAlertService
@ContributesAndroidInjector abstract fun contributesInsightConnectionService(): InsightConnectionService @ContributesAndroidInjector abstract fun contributesInsightConnectionService(): InsightConnectionService
@ContributesAndroidInjector abstract fun contributesRileyLinkService(): info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.RileyLinkService @ContributesAndroidInjector abstract fun contributesRileyLinkService(): RileyLinkService
@ContributesAndroidInjector abstract fun contributesRileyLinkMedtronicService(): info.nightscout.androidaps.plugins.pump.medtronic.service.RileyLinkMedtronicService @ContributesAndroidInjector abstract fun contributesRileyLinkMedtronicService(): RileyLinkMedtronicService
@ContributesAndroidInjector abstract fun contributesRileyLinkOmnipodService(): RileyLinkOmnipodService @ContributesAndroidInjector abstract fun contributesRileyLinkOmnipodService(): RileyLinkOmnipodService
} }

View file

@ -1,11 +1,7 @@
package info.nightscout.androidaps.interfaces package info.nightscout.androidaps.interfaces
import com.j256.ormlite.dao.CloseableIterator import com.j256.ormlite.dao.CloseableIterator
import info.nightscout.androidaps.db.BgReading import info.nightscout.androidaps.db.*
import info.nightscout.androidaps.db.CareportalEvent
import info.nightscout.androidaps.db.DanaRHistoryRecord
import info.nightscout.androidaps.db.DbRequest
import info.nightscout.androidaps.db.TDD
interface DatabaseHelperInterface { interface DatabaseHelperInterface {

View file

@ -21,7 +21,6 @@ public class DateTimeUtil {
* @param atechDateTime * @param atechDateTime
* @return * @return
*/ */
@Deprecated // use joda instead
public static LocalDateTime toLocalDateTime(long atechDateTime) { public static LocalDateTime toLocalDateTime(long atechDateTime) {
int year = (int) (atechDateTime / 10000000000L); int year = (int) (atechDateTime / 10000000000L);
atechDateTime -= year * 10000000000L; atechDateTime -= year * 10000000000L;
@ -56,7 +55,6 @@ public class DateTimeUtil {
* @param atechDateTime * @param atechDateTime
* @return * @return
*/ */
@Deprecated // use joda instead
public static GregorianCalendar toGregorianCalendar(long atechDateTime) { public static GregorianCalendar toGregorianCalendar(long atechDateTime) {
int year = (int) (atechDateTime / 10000000000L); int year = (int) (atechDateTime / 10000000000L);
atechDateTime -= year * 10000000000L; atechDateTime -= year * 10000000000L;

View file

@ -123,7 +123,7 @@ class MedtronicFragment : DaggerFragment() {
.toObservable(EventRileyLinkDeviceStatusChange::class.java) .toObservable(EventRileyLinkDeviceStatusChange::class.java)
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.subscribe({ .subscribe({
aapsLogger.debug(LTag.PUMP, "onStatusEvent(EventMedtronicDeviceStatusChange): $it") aapsLogger.debug(LTag.PUMP, "onStatusEvent(EventRileyLinkDeviceStatusChange): $it")
setDeviceStatus() setDeviceStatus()
}, { fabricPrivacy.logException(it) }) }, { fabricPrivacy.logException(it) })
disposable += rxBus disposable += rxBus

View file

@ -771,7 +771,7 @@ public class MedtronicPumpPlugin extends PumpPluginAbstract implements PumpInter
if ((clock.localDeviceTime.getYear() <= 2015) || (timeDiff <= 24 * 60 * 60)) { if ((clock.localDeviceTime.getYear() <= 2015) || (timeDiff <= 24 * 60 * 60)) {
aapsLogger.info(LTag.PUMP, "MedtronicPumpPlugin::checkTimeAndOptionallySetTime - Time difference is {} s. Set time on pump." + timeDiff); aapsLogger.info(LTag.PUMP, "MedtronicPumpPlugin::checkTimeAndOptionallySetTime - Time difference is {} s. Set time on pump." , timeDiff);
rileyLinkMedtronicService.getMedtronicUIComm().executeCommand(MedtronicCommandType.SetRealTimeClock); rileyLinkMedtronicService.getMedtronicUIComm().executeCommand(MedtronicCommandType.SetRealTimeClock);
@ -781,13 +781,13 @@ public class MedtronicPumpPlugin extends PumpPluginAbstract implements PumpInter
} }
} else { } else {
if ((clock.localDeviceTime.getYear() > 2015)) { if ((clock.localDeviceTime.getYear() > 2015)) {
aapsLogger.error("MedtronicPumpPlugin::checkTimeAndOptionallySetTime - Time difference over 24h requested [diff={}]. Doing nothing." + timeDiff); aapsLogger.error("MedtronicPumpPlugin::checkTimeAndOptionallySetTime - Time difference over 24h requested [diff={} s]. Doing nothing.", timeDiff);
medtronicUtil.sendNotification(MedtronicNotificationType.TimeChangeOver24h, getResourceHelper(), rxBus); medtronicUtil.sendNotification(MedtronicNotificationType.TimeChangeOver24h, getResourceHelper(), rxBus);
} }
} }
} else { } else {
aapsLogger.info(LTag.PUMP, "MedtronicPumpPlugin::checkTimeAndOptionallySetTime - Time difference is {} s. Do nothing." + timeDiff); aapsLogger.info(LTag.PUMP, "MedtronicPumpPlugin::checkTimeAndOptionallySetTime - Time difference is {} s. Do nothing.", timeDiff);
} }
scheduleNextRefresh(MedtronicStatusRefreshType.PumpTime, 0); scheduleNextRefresh(MedtronicStatusRefreshType.PumpTime, 0);
@ -1133,11 +1133,14 @@ public class MedtronicPumpPlugin extends PumpPluginAbstract implements PumpInter
private void readPumpHistoryLogic() { private void readPumpHistoryLogic() {
boolean debugHistory = false;
LocalDateTime targetDate = null; LocalDateTime targetDate = null;
if (lastPumpHistoryEntry == null) { if (lastPumpHistoryEntry == null) {
aapsLogger.debug(LTag.PUMP, getLogPrefix() + "readPumpHistoryLogic(): lastPumpHistoryEntry: null"); if (debugHistory)
aapsLogger.debug(LTag.PUMP, getLogPrefix() + "readPumpHistoryLogic(): lastPumpHistoryEntry: null");
Long lastPumpHistoryEntryTime = getLastPumpEntryTime(); Long lastPumpHistoryEntryTime = getLastPumpEntryTime();
@ -1146,13 +1149,15 @@ public class MedtronicPumpPlugin extends PumpPluginAbstract implements PumpInter
medtronicHistoryData.setIsInInit(true); medtronicHistoryData.setIsInInit(true);
if (lastPumpHistoryEntryTime == 0L) { if (lastPumpHistoryEntryTime == 0L) {
aapsLogger.debug(LTag.PUMP, getLogPrefix() + "readPumpHistoryLogic(): lastPumpHistoryEntryTime: 0L - targetDate: " if (debugHistory)
+ targetDate); aapsLogger.debug(LTag.PUMP, getLogPrefix() + "readPumpHistoryLogic(): lastPumpHistoryEntryTime: 0L - targetDate: "
+ targetDate);
targetDate = timeMinus36h; targetDate = timeMinus36h;
} else { } else {
// LocalDateTime lastHistoryRecordTime = DateTimeUtil.toLocalDateTime(lastPumpHistoryEntryTime); // LocalDateTime lastHistoryRecordTime = DateTimeUtil.toLocalDateTime(lastPumpHistoryEntryTime);
aapsLogger.debug(LTag.PUMP, getLogPrefix() + "readPumpHistoryLogic(): lastPumpHistoryEntryTime: " + lastPumpHistoryEntryTime + " - targetDate: " + targetDate); if (debugHistory)
aapsLogger.debug(LTag.PUMP, getLogPrefix() + "readPumpHistoryLogic(): lastPumpHistoryEntryTime: " + lastPumpHistoryEntryTime + " - targetDate: " + targetDate);
medtronicHistoryData.setLastHistoryRecordTime(lastPumpHistoryEntryTime); medtronicHistoryData.setLastHistoryRecordTime(lastPumpHistoryEntryTime);
@ -1168,30 +1173,35 @@ public class MedtronicPumpPlugin extends PumpPluginAbstract implements PumpInter
targetDate = (timeMinus36h.isAfter(lastHistoryRecordTime) ? timeMinus36h : lastHistoryRecordTime); targetDate = (timeMinus36h.isAfter(lastHistoryRecordTime) ? timeMinus36h : lastHistoryRecordTime);
aapsLogger.debug(LTag.PUMP, getLogPrefix() + "readPumpHistoryLogic(): targetDate: " + targetDate); if (debugHistory)
aapsLogger.debug(LTag.PUMP, getLogPrefix() + "readPumpHistoryLogic(): targetDate: " + targetDate);
} }
} else { } else {
aapsLogger.debug(LTag.PUMP, getLogPrefix() + "readPumpHistoryLogic(): lastPumpHistoryEntry: not null - " + medtronicUtil.gsonInstance.toJson(lastPumpHistoryEntry)); if (debugHistory)
aapsLogger.debug(LTag.PUMP, getLogPrefix() + "readPumpHistoryLogic(): lastPumpHistoryEntry: not null - " + medtronicUtil.gsonInstance.toJson(lastPumpHistoryEntry));
medtronicHistoryData.setIsInInit(false); medtronicHistoryData.setIsInInit(false);
// medtronicHistoryData.setLastHistoryRecordTime(lastPumpHistoryEntry.atechDateTime); // medtronicHistoryData.setLastHistoryRecordTime(lastPumpHistoryEntry.atechDateTime);
// targetDate = lastPumpHistoryEntry.atechDateTime; // targetDate = lastPumpHistoryEntry.atechDateTime;
} }
aapsLogger.debug(LTag.PUMP, "HST: Target Date: " + targetDate); //aapsLogger.debug(LTag.PUMP, "HST: Target Date: " + targetDate);
MedtronicUITask responseTask2 = rileyLinkMedtronicService.getMedtronicUIComm().executeCommand(MedtronicCommandType.GetHistoryData, MedtronicUITask responseTask2 = rileyLinkMedtronicService.getMedtronicUIComm().executeCommand(MedtronicCommandType.GetHistoryData,
lastPumpHistoryEntry, targetDate); lastPumpHistoryEntry, targetDate);
aapsLogger.debug(LTag.PUMP, "HST: After task"); if (debugHistory)
aapsLogger.debug(LTag.PUMP, "HST: After task");
PumpHistoryResult historyResult = (PumpHistoryResult) responseTask2.returnData; PumpHistoryResult historyResult = (PumpHistoryResult) responseTask2.returnData;
aapsLogger.debug(LTag.PUMP, "HST: History Result: " + historyResult.toString()); if (debugHistory)
aapsLogger.debug(LTag.PUMP, "HST: History Result: " + historyResult.toString());
PumpHistoryEntry latestEntry = historyResult.getLatestEntry(); PumpHistoryEntry latestEntry = historyResult.getLatestEntry();
aapsLogger.debug(LTag.PUMP, getLogPrefix() + "Last entry: " + latestEntry); if (debugHistory)
aapsLogger.debug(LTag.PUMP, getLogPrefix() + "Last entry: " + latestEntry);
if (latestEntry == null) // no new history to read if (latestEntry == null) // no new history to read
return; return;
@ -1199,7 +1209,8 @@ public class MedtronicPumpPlugin extends PumpPluginAbstract implements PumpInter
this.lastPumpHistoryEntry = latestEntry; this.lastPumpHistoryEntry = latestEntry;
sp.putLong(MedtronicConst.Statistics.LastPumpHistoryEntry, latestEntry.atechDateTime); sp.putLong(MedtronicConst.Statistics.LastPumpHistoryEntry, latestEntry.atechDateTime);
aapsLogger.debug(LTag.PUMP, "HST: History: valid=" + historyResult.validEntries.size() + ", unprocessed=" + historyResult.unprocessedEntries.size()); if (debugHistory)
aapsLogger.debug(LTag.PUMP, "HST: History: valid=" + historyResult.validEntries.size() + ", unprocessed=" + historyResult.unprocessedEntries.size());
this.medtronicHistoryData.addNewHistory(historyResult); this.medtronicHistoryData.addNewHistory(historyResult);
this.medtronicHistoryData.filterNewEntries(); this.medtronicHistoryData.filterNewEntries();
@ -1221,11 +1232,9 @@ public class MedtronicPumpPlugin extends PumpPluginAbstract implements PumpInter
// update to last entry // update to last entry
// - save // - save
// - determine pump status // - determine pump status
//
} }
private Long getLastPumpEntryTime() { private Long getLastPumpEntryTime() {
Long lastPumpEntryTime = sp.getLong(MedtronicConst.Statistics.LastPumpHistoryEntry, 0L); Long lastPumpEntryTime = sp.getLong(MedtronicConst.Statistics.LastPumpHistoryEntry, 0L);

View file

@ -118,7 +118,7 @@ public abstract class MedtronicHistoryDecoder<T extends MedtronicHistoryEntry> i
StringUtil.appendToStringBuilder(sb, "" + unknownEntry.getKey(), ", "); StringUtil.appendToStringBuilder(sb, "" + unknownEntry.getKey(), ", ");
} }
aapsLogger.error(LTag.PUMPCOMM, "STATISTICS OF PUMP DECODE"); aapsLogger.info(LTag.PUMPCOMM, "STATISTICS OF PUMP DECODE");
if (unknownOpCodes.size() > 0) { if (unknownOpCodes.size() > 0) {
aapsLogger.warn(LTag.PUMPCOMM, "Unknown Op Codes: {}", sb.toString()); aapsLogger.warn(LTag.PUMPCOMM, "Unknown Op Codes: {}", sb.toString());
@ -137,9 +137,9 @@ public abstract class MedtronicHistoryDecoder<T extends MedtronicHistoryEntry> i
String spaces = StringUtils.repeat(" ", 14 - entry.getKey().name().length()); String spaces = StringUtils.repeat(" ", 14 - entry.getKey().name().length());
aapsLogger.error(LTag.PUMPCOMM, " {}{} - {}. Elements: {}", entry.getKey().name(), spaces, entry.getValue().size(), sb.toString()); aapsLogger.info(LTag.PUMPCOMM, " {}{} - {}. Elements: {}", entry.getKey().name(), spaces, entry.getValue().size(), sb.toString());
} else { } else {
aapsLogger.error(LTag.PUMPCOMM, " {} - {}", entry.getKey().name(), entry.getValue().size()); aapsLogger.info(LTag.PUMPCOMM, " {} - {}", entry.getKey().name(), entry.getValue().size());
} }
} }
} }

View file

@ -34,7 +34,7 @@ public class MedtronicUIComm {
public synchronized MedtronicUITask executeCommand(MedtronicCommandType commandType, Object... parameters) { public synchronized MedtronicUITask executeCommand(MedtronicCommandType commandType, Object... parameters) {
aapsLogger.warn(LTag.PUMP, "Execute Command: " + commandType.name()); aapsLogger.info(LTag.PUMP, "Execute Command: " + commandType.name());
MedtronicUITask task = new MedtronicUITask(injector, commandType, parameters); MedtronicUITask task = new MedtronicUITask(injector, commandType, parameters);

View file

@ -161,7 +161,8 @@ public class MedtronicUIPostprocessor {
// no postprocessing // no postprocessing
default: default:
aapsLogger.error(LTag.PUMP, "Post-processing not implemented for {}.", uiTask.commandType.name()); break;
//aapsLogger.error(LTag.PUMP, "Post-processing not implemented for {}.", uiTask.commandType.name());
} }

View file

@ -205,36 +205,35 @@ public class DailyTotalsDTO {
//LOG.debug("523: {}", toString()); //LOG.debug("523: {}", toString());
} }
@Override @Override
public String toString() { public String toString() {
return "DailyTotalsDTO [" + return new ToStringBuilder(this)
"bgAvg=" + bgAvg + .append("bgAvg", bgAvg)
", bgLow=" + bgLow + .append("bgLow", bgLow)
", bgHigh=" + bgHigh + .append("bgHigh", bgHigh)
", bgCount=" + bgCount + .append("bgCount", bgCount)
", sensorAvg=" + sensorAvg + .append("sensorAvg", sensorAvg)
", sensorMin=" + sensorMin + .append("sensorMin", sensorMin)
", sensorMax=" + sensorMax + .append("sensorMax", sensorMax)
", sensorCalcCount=" + sensorCalcCount + .append("sensorCalcCount", sensorCalcCount)
", sensorDataCount=" + sensorDataCount + .append("sensorDataCount", sensorDataCount)
", insulinTotal=" + insulinTotal + .append("insulinTotal", insulinTotal)
", insulinBasal=" + insulinBasal + .append("insulinBasal", insulinBasal)
", insulinBolus=" + insulinBolus + .append("insulinBolus", insulinBolus)
", insulinCarbs=" + insulinCarbs + .append("insulinCarbs", insulinCarbs)
", bolusTotal=" + bolusTotal + .append("bolusTotal", bolusTotal)
", bolusFood=" + bolusFood + .append("bolusFood", bolusFood)
", bolusFoodAndCorr=" + bolusFoodAndCorr + .append("bolusFoodAndCorr", bolusFoodAndCorr)
", bolusCorrection=" + bolusCorrection + .append("bolusCorrection", bolusCorrection)
", bolusManual=" + bolusManual + .append("bolusManual", bolusManual)
", bolusCount=" + bolusCount + .append("bolusCount", bolusCount)
", bolusCountFoodOrCorr=" + bolusCountFoodOrCorr + .append("bolusCountFoodOrCorr", bolusCountFoodOrCorr)
", bolusCountFoodAndCorr=" + bolusCountFoodAndCorr + .append("bolusCountFoodAndCorr", bolusCountFoodAndCorr)
", bolusCountManual=" + bolusCountManual + .append("bolusCountManual", bolusCountManual)
", bolusCountFood=" + bolusCountFood + .append("bolusCountFood", bolusCountFood)
", bolusCountCorr=" + bolusCountCorr + .append("bolusCountCorr", bolusCountCorr)
", entry=" + entry + .append("entry", entry)
']'; .toString();
} }
public void setTDD(TDD tdd) { public void setTDD(TDD tdd) {