better EVENT logging
This commit is contained in:
parent
eb99dbb362
commit
551af710b6
|
@ -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)
|
||||
|
|
|
@ -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()
|
||||
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)
|
||||
}
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue