diff --git a/app/src/main/java/info/nightscout/androidaps/activities/HistoryBrowseActivity.kt b/app/src/main/java/info/nightscout/androidaps/activities/HistoryBrowseActivity.kt index 4bf1faae41..25e26d84f3 100644 --- a/app/src/main/java/info/nightscout/androidaps/activities/HistoryBrowseActivity.kt +++ b/app/src/main/java/info/nightscout/androidaps/activities/HistoryBrowseActivity.kt @@ -167,7 +167,7 @@ class HistoryBrowseActivity : TranslatedDaggerAppCompatActivity() { disposable += rxBus .toObservable(EventIobCalculationProgress::class.java) .observeOn(aapsSchedulers.main) - .subscribe({ updateCalcProgress(it.pass.finalPercent(it.progressPct)) }, fabricPrivacy::logException) + .subscribe({ updateCalcProgress(it.finalPercent) }, fabricPrivacy::logException) disposable += rxBus .toObservable(EventUpdateOverviewGraph::class.java) .observeOn(aapsSchedulers.main) diff --git a/core/main/src/main/java/info/nightscout/core/events/EventIobCalculationProgress.kt b/core/main/src/main/java/info/nightscout/core/events/EventIobCalculationProgress.kt index c532aeaa21..cfeefba518 100644 --- a/core/main/src/main/java/info/nightscout/core/events/EventIobCalculationProgress.kt +++ b/core/main/src/main/java/info/nightscout/core/events/EventIobCalculationProgress.kt @@ -3,4 +3,10 @@ package info.nightscout.core.events import info.nightscout.core.workflow.CalculationWorkflow import info.nightscout.rx.events.Event -class EventIobCalculationProgress(val pass: CalculationWorkflow.ProgressData, val progressPct: Int, val cause: Event?) : Event() \ No newline at end of file +class EventIobCalculationProgress(val pass: CalculationWorkflow.ProgressData, private val progressPct: Int, val cause: Event?) : Event() { + + override fun toString(): String = + "EventIobCalculationProgress[cause=$cause,pass=$pass,progressPct=$progressPct,finalPercent=$finalPercent]" + + val finalPercent get() = pass.finalPercent(progressPct) +} \ No newline at end of file diff --git a/plugins/main/src/main/java/info/nightscout/plugins/general/overview/OverviewPlugin.kt b/plugins/main/src/main/java/info/nightscout/plugins/general/overview/OverviewPlugin.kt index 6b06358464..9d1c215d9e 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/general/overview/OverviewPlugin.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/general/overview/OverviewPlugin.kt @@ -122,7 +122,7 @@ class OverviewPlugin @Inject constructor( .toObservable(EventIobCalculationProgress::class.java) .observeOn(aapsSchedulers.io) .subscribe({ - overviewData.calcProgressPct = it.pass.finalPercent(it.progressPct) + overviewData.calcProgressPct = it.finalPercent overviewBus.send(EventUpdateOverviewCalcProgress("EventIobCalculationProgress")) }, fabricPrivacy::logException) disposable += rxBus