History activity performance improvement
This commit is contained in:
parent
7a086450b5
commit
ec3ebd17db
5 changed files with 113 additions and 79 deletions
|
@ -3,7 +3,6 @@ package info.nightscout.androidaps.historyBrowser
|
||||||
import android.app.DatePickerDialog
|
import android.app.DatePickerDialog
|
||||||
import android.graphics.Color
|
import android.graphics.Color
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.os.SystemClock
|
|
||||||
import android.util.DisplayMetrics
|
import android.util.DisplayMetrics
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.widget.LinearLayout
|
import android.widget.LinearLayout
|
||||||
|
@ -15,12 +14,13 @@ import info.nightscout.androidaps.activities.NoSplashAppCompatActivity
|
||||||
import info.nightscout.androidaps.events.EventCustomCalculationFinished
|
import info.nightscout.androidaps.events.EventCustomCalculationFinished
|
||||||
import info.nightscout.androidaps.events.EventRefreshOverview
|
import info.nightscout.androidaps.events.EventRefreshOverview
|
||||||
import info.nightscout.androidaps.interfaces.ActivePluginProvider
|
import info.nightscout.androidaps.interfaces.ActivePluginProvider
|
||||||
|
import info.nightscout.androidaps.interfaces.ProfileFunction
|
||||||
import info.nightscout.androidaps.logging.AAPSLogger
|
import info.nightscout.androidaps.logging.AAPSLogger
|
||||||
import info.nightscout.androidaps.logging.LTag
|
import info.nightscout.androidaps.logging.LTag
|
||||||
import info.nightscout.androidaps.plugins.bus.RxBusWrapper
|
import info.nightscout.androidaps.plugins.bus.RxBusWrapper
|
||||||
import info.nightscout.androidaps.interfaces.ProfileFunction
|
|
||||||
import info.nightscout.androidaps.plugins.general.overview.OverviewMenus
|
import info.nightscout.androidaps.plugins.general.overview.OverviewMenus
|
||||||
import info.nightscout.androidaps.plugins.general.overview.graphData.GraphData
|
import info.nightscout.androidaps.plugins.general.overview.graphData.GraphData
|
||||||
|
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventAutosensBgLoaded
|
||||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventAutosensCalculationFinished
|
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventAutosensCalculationFinished
|
||||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventIobCalculationProgress
|
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventIobCalculationProgress
|
||||||
import info.nightscout.androidaps.utils.DateUtil
|
import info.nightscout.androidaps.utils.DateUtil
|
||||||
|
@ -33,6 +33,7 @@ import info.nightscout.androidaps.utils.resources.ResourceHelper
|
||||||
import info.nightscout.androidaps.utils.sharedPreferences.SP
|
import info.nightscout.androidaps.utils.sharedPreferences.SP
|
||||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||||
import io.reactivex.disposables.CompositeDisposable
|
import io.reactivex.disposables.CompositeDisposable
|
||||||
|
import io.reactivex.schedulers.Schedulers
|
||||||
import kotlinx.android.synthetic.main.activity_historybrowse.*
|
import kotlinx.android.synthetic.main.activity_historybrowse.*
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.GlobalScope
|
import kotlinx.coroutines.GlobalScope
|
||||||
|
@ -74,12 +75,10 @@ class HistoryBrowseActivity : NoSplashAppCompatActivity() {
|
||||||
|
|
||||||
historybrowse_left.setOnClickListener {
|
historybrowse_left.setOnClickListener {
|
||||||
start -= T.hours(rangeToDisplay.toLong()).msecs()
|
start -= T.hours(rangeToDisplay.toLong()).msecs()
|
||||||
updateGUI("onClickLeft")
|
|
||||||
runCalculation("onClickLeft")
|
runCalculation("onClickLeft")
|
||||||
}
|
}
|
||||||
historybrowse_right.setOnClickListener {
|
historybrowse_right.setOnClickListener {
|
||||||
start += T.hours(rangeToDisplay.toLong()).msecs()
|
start += T.hours(rangeToDisplay.toLong()).msecs()
|
||||||
updateGUI("onClickRight")
|
|
||||||
runCalculation("onClickRight")
|
runCalculation("onClickRight")
|
||||||
}
|
}
|
||||||
historybrowse_end.setOnClickListener {
|
historybrowse_end.setOnClickListener {
|
||||||
|
@ -90,13 +89,12 @@ class HistoryBrowseActivity : NoSplashAppCompatActivity() {
|
||||||
calendar[Calendar.MINUTE] = 0
|
calendar[Calendar.MINUTE] = 0
|
||||||
calendar[Calendar.HOUR_OF_DAY] = 0
|
calendar[Calendar.HOUR_OF_DAY] = 0
|
||||||
start = calendar.timeInMillis
|
start = calendar.timeInMillis
|
||||||
updateGUI("onClickEnd")
|
|
||||||
runCalculation("onClickEnd")
|
runCalculation("onClickEnd")
|
||||||
}
|
}
|
||||||
historybrowse_zoom.setOnClickListener {
|
historybrowse_zoom.setOnClickListener {
|
||||||
rangeToDisplay += 6
|
rangeToDisplay += 6
|
||||||
rangeToDisplay = if (rangeToDisplay > 24) 6 else rangeToDisplay
|
rangeToDisplay = if (rangeToDisplay > 24) 6 else rangeToDisplay
|
||||||
updateGUI("rangeChange")
|
updateGUI("rangeChange", false)
|
||||||
}
|
}
|
||||||
historybrowse_zoom.setOnLongClickListener {
|
historybrowse_zoom.setOnLongClickListener {
|
||||||
val calendar = Calendar.getInstance()
|
val calendar = Calendar.getInstance()
|
||||||
|
@ -106,7 +104,6 @@ class HistoryBrowseActivity : NoSplashAppCompatActivity() {
|
||||||
calendar[Calendar.MINUTE] = 0
|
calendar[Calendar.MINUTE] = 0
|
||||||
calendar[Calendar.HOUR_OF_DAY] = 0
|
calendar[Calendar.HOUR_OF_DAY] = 0
|
||||||
start = calendar.timeInMillis
|
start = calendar.timeInMillis
|
||||||
updateGUI("resetToMidnight")
|
|
||||||
runCalculation("onLongClickZoom")
|
runCalculation("onLongClickZoom")
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
@ -120,7 +117,6 @@ class HistoryBrowseActivity : NoSplashAppCompatActivity() {
|
||||||
cal.set(Calendar.DAY_OF_MONTH, dayOfMonth)
|
cal.set(Calendar.DAY_OF_MONTH, dayOfMonth)
|
||||||
start = cal.timeInMillis
|
start = cal.timeInMillis
|
||||||
historybrowse_date?.text = dateUtil.dateAndTimeString(start)
|
historybrowse_date?.text = dateUtil.dateAndTimeString(start)
|
||||||
updateGUI("onClickDate")
|
|
||||||
runCalculation("onClickDate")
|
runCalculation("onClickDate")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -144,6 +140,11 @@ class HistoryBrowseActivity : NoSplashAppCompatActivity() {
|
||||||
|
|
||||||
overviewMenus.setupChartMenu(overview_chartMenuButton)
|
overviewMenus.setupChartMenu(overview_chartMenuButton)
|
||||||
prepareGraphs()
|
prepareGraphs()
|
||||||
|
savedInstanceState?.let { bundle ->
|
||||||
|
rangeToDisplay = bundle.getInt("rangeToDisplay", 0)
|
||||||
|
start = bundle.getLong("start", 0)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override fun onPause() {
|
public override fun onPause() {
|
||||||
|
@ -156,12 +157,21 @@ class HistoryBrowseActivity : NoSplashAppCompatActivity() {
|
||||||
super.onResume()
|
super.onResume()
|
||||||
disposable.add(rxBus
|
disposable.add(rxBus
|
||||||
.toObservable(EventAutosensCalculationFinished::class.java)
|
.toObservable(EventAutosensCalculationFinished::class.java)
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(Schedulers.io())
|
||||||
.subscribe({ event: EventAutosensCalculationFinished ->
|
.subscribe({
|
||||||
// catch only events from iobCobCalculatorPluginHistory
|
// catch only events from iobCobCalculatorPluginHistory
|
||||||
if (event.cause === eventCustomCalculationFinished) {
|
if (it.cause is EventCustomCalculationFinished) {
|
||||||
aapsLogger.debug(LTag.AUTOSENS, "EventAutosensCalculationFinished")
|
updateGUI("EventAutosensCalculationFinished", bgOnly = false)
|
||||||
updateGUI("EventAutosensCalculationFinished")
|
}
|
||||||
|
}) { fabricPrivacy::logException }
|
||||||
|
)
|
||||||
|
disposable.add(rxBus
|
||||||
|
.toObservable(EventAutosensBgLoaded::class.java)
|
||||||
|
.observeOn(Schedulers.io())
|
||||||
|
.subscribe({
|
||||||
|
// catch only events from iobCobCalculatorPluginHistory
|
||||||
|
if (it.cause is EventCustomCalculationFinished) {
|
||||||
|
updateGUI("EventAutosensCalculationFinished", bgOnly = true)
|
||||||
}
|
}
|
||||||
}) { fabricPrivacy::logException }
|
}) { fabricPrivacy::logException }
|
||||||
)
|
)
|
||||||
|
@ -174,10 +184,13 @@ class HistoryBrowseActivity : NoSplashAppCompatActivity() {
|
||||||
.toObservable(EventRefreshOverview::class.java)
|
.toObservable(EventRefreshOverview::class.java)
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribe({
|
.subscribe({
|
||||||
|
if (it.now) {
|
||||||
prepareGraphs()
|
prepareGraphs()
|
||||||
updateGUI("EventRefreshOverview")
|
updateGUI("EventRefreshOverview", bgOnly = false)
|
||||||
|
}
|
||||||
}) { fabricPrivacy::logException }
|
}) { fabricPrivacy::logException }
|
||||||
)
|
)
|
||||||
|
if (start == 0L) {
|
||||||
// set start of current day
|
// set start of current day
|
||||||
val calendar = Calendar.getInstance()
|
val calendar = Calendar.getInstance()
|
||||||
calendar.timeInMillis = System.currentTimeMillis()
|
calendar.timeInMillis = System.currentTimeMillis()
|
||||||
|
@ -187,8 +200,16 @@ class HistoryBrowseActivity : NoSplashAppCompatActivity() {
|
||||||
calendar[Calendar.HOUR_OF_DAY] = 0
|
calendar[Calendar.HOUR_OF_DAY] = 0
|
||||||
start = calendar.timeInMillis
|
start = calendar.timeInMillis
|
||||||
runCalculation("onResume")
|
runCalculation("onResume")
|
||||||
SystemClock.sleep(1000)
|
} else {
|
||||||
updateGUI("onResume")
|
updateGUI("onResume", bgOnly = false)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onSaveInstanceState(outState: Bundle) {
|
||||||
|
super.onSaveInstanceState(outState)
|
||||||
|
outState.putInt("rangeToDisplay", rangeToDisplay)
|
||||||
|
outState.putLong("start", start)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun prepareGraphs() {
|
private fun prepareGraphs() {
|
||||||
|
@ -221,29 +242,30 @@ class HistoryBrowseActivity : NoSplashAppCompatActivity() {
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun runCalculation(from: String) {
|
private fun runCalculation(from: String) {
|
||||||
|
GlobalScope.launch(Dispatchers.Default) {
|
||||||
treatmentsPluginHistory.initializeData(start - T.hours(8).msecs())
|
treatmentsPluginHistory.initializeData(start - T.hours(8).msecs())
|
||||||
val end = start + T.hours(rangeToDisplay.toLong()).msecs()
|
val end = start + T.hours(rangeToDisplay.toLong()).msecs()
|
||||||
iobCobCalculatorPluginHistory.stopCalculation(from)
|
iobCobCalculatorPluginHistory.stopCalculation(from)
|
||||||
iobCobCalculatorPluginHistory.clearCache()
|
iobCobCalculatorPluginHistory.clearCache()
|
||||||
iobCobCalculatorPluginHistory.runCalculation(from, end, true, false, eventCustomCalculationFinished)
|
iobCobCalculatorPluginHistory.runCalculation(from, end, true, false, eventCustomCalculationFinished)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Synchronized
|
fun updateGUI(from: String, bgOnly: Boolean) {
|
||||||
fun updateGUI(from: String) {
|
|
||||||
aapsLogger.debug(LTag.UI, "updateGUI from: $from")
|
aapsLogger.debug(LTag.UI, "updateGUI from: $from")
|
||||||
val pump = activePlugin.activePump
|
val pump = activePlugin.activePump
|
||||||
val profile = profileFunction.getProfile()
|
val profile = profileFunction.getProfile()
|
||||||
|
|
||||||
historybrowse_noprofile?.visibility = (profile == null).toVisibility()
|
|
||||||
profile ?: return
|
|
||||||
|
|
||||||
val lowLine = defaultValueHelper.determineLowLine()
|
val lowLine = defaultValueHelper.determineLowLine()
|
||||||
val highLine = defaultValueHelper.determineHighLine()
|
val highLine = defaultValueHelper.determineHighLine()
|
||||||
historybrowse_date?.text = dateUtil.dateAndTimeString(start)
|
|
||||||
historybrowse_zoom?.text = rangeToDisplay.toString()
|
|
||||||
|
|
||||||
GlobalScope.launch(Dispatchers.Main) {
|
GlobalScope.launch(Dispatchers.Main) {
|
||||||
|
historybrowse_noprofile?.visibility = (profile == null).toVisibility()
|
||||||
|
profile ?: return@launch
|
||||||
|
|
||||||
historybrowse_bggraph ?: return@launch
|
historybrowse_bggraph ?: return@launch
|
||||||
|
historybrowse_date?.text = dateUtil.dateAndTimeString(start)
|
||||||
|
historybrowse_zoom?.text = rangeToDisplay.toString()
|
||||||
val graphData = GraphData(injector, historybrowse_bggraph, iobCobCalculatorPluginHistory, treatmentsPluginHistory)
|
val graphData = GraphData(injector, historybrowse_bggraph, iobCobCalculatorPluginHistory, treatmentsPluginHistory)
|
||||||
val secondaryGraphsData: ArrayList<GraphData> = ArrayList()
|
val secondaryGraphsData: ArrayList<GraphData> = ArrayList()
|
||||||
|
|
||||||
|
@ -263,6 +285,13 @@ class HistoryBrowseActivity : NoSplashAppCompatActivity() {
|
||||||
// set manual x bounds to have nice steps
|
// set manual x bounds to have nice steps
|
||||||
graphData.formatAxis(fromTime, toTime)
|
graphData.formatAxis(fromTime, toTime)
|
||||||
|
|
||||||
|
// add target line
|
||||||
|
graphData.addTargetLine(fromTime, toTime, profile, null)
|
||||||
|
|
||||||
|
// **** NOW line ****
|
||||||
|
graphData.addNowLine(pointer)
|
||||||
|
|
||||||
|
if (!bgOnly) {
|
||||||
// Treatments
|
// Treatments
|
||||||
graphData.addTreatments(fromTime, toTime)
|
graphData.addTreatments(fromTime, toTime)
|
||||||
if (overviewMenus.setting[0][OverviewMenus.CharType.ACT.ordinal])
|
if (overviewMenus.setting[0][OverviewMenus.CharType.ACT.ordinal])
|
||||||
|
@ -272,13 +301,6 @@ class HistoryBrowseActivity : NoSplashAppCompatActivity() {
|
||||||
if (pump.pumpDescription.isTempBasalCapable && overviewMenus.setting[0][OverviewMenus.CharType.BAS.ordinal]) {
|
if (pump.pumpDescription.isTempBasalCapable && overviewMenus.setting[0][OverviewMenus.CharType.BAS.ordinal]) {
|
||||||
graphData.addBasals(fromTime, toTime, lowLine / graphData.maxY / 1.2)
|
graphData.addBasals(fromTime, toTime, lowLine / graphData.maxY / 1.2)
|
||||||
}
|
}
|
||||||
|
|
||||||
// add target line
|
|
||||||
graphData.addTargetLine(fromTime, toTime, profile, null)
|
|
||||||
|
|
||||||
// **** NOW line ****
|
|
||||||
graphData.addNowLine(pointer)
|
|
||||||
|
|
||||||
// ------------------ 2nd graph
|
// ------------------ 2nd graph
|
||||||
for (g in 0 until secondaryGraphs.size) {
|
for (g in 0 until secondaryGraphs.size) {
|
||||||
val secondGraphData = GraphData(injector, secondaryGraphs[g], iobCobCalculatorPluginHistory, treatmentsPluginHistory)
|
val secondGraphData = GraphData(injector, secondaryGraphs[g], iobCobCalculatorPluginHistory, treatmentsPluginHistory)
|
||||||
|
@ -313,11 +335,12 @@ class HistoryBrowseActivity : NoSplashAppCompatActivity() {
|
||||||
secondaryGraphsData.add(secondGraphData)
|
secondaryGraphsData.add(secondGraphData)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// finally enforce drawing of graphs in UI thread
|
// finally enforce drawing of graphs in UI thread
|
||||||
graphData.performUpdate()
|
graphData.performUpdate()
|
||||||
for (g in 0 until secondaryGraphs.size) {
|
for (g in 0 until secondaryGraphs.size) {
|
||||||
secondaryGraphsLabel[g].text = overviewMenus.enabledTypes(g + 1)
|
secondaryGraphsLabel[g].text = overviewMenus.enabledTypes(g + 1)
|
||||||
secondaryGraphs[g].visibility = (
|
secondaryGraphs[g].visibility = (!bgOnly && (
|
||||||
overviewMenus.setting[g + 1][OverviewMenus.CharType.IOB.ordinal] ||
|
overviewMenus.setting[g + 1][OverviewMenus.CharType.IOB.ordinal] ||
|
||||||
overviewMenus.setting[g + 1][OverviewMenus.CharType.COB.ordinal] ||
|
overviewMenus.setting[g + 1][OverviewMenus.CharType.COB.ordinal] ||
|
||||||
overviewMenus.setting[g + 1][OverviewMenus.CharType.DEV.ordinal] ||
|
overviewMenus.setting[g + 1][OverviewMenus.CharType.DEV.ordinal] ||
|
||||||
|
@ -325,7 +348,7 @@ class HistoryBrowseActivity : NoSplashAppCompatActivity() {
|
||||||
overviewMenus.setting[g + 1][OverviewMenus.CharType.ACT.ordinal] ||
|
overviewMenus.setting[g + 1][OverviewMenus.CharType.ACT.ordinal] ||
|
||||||
overviewMenus.setting[g + 1][OverviewMenus.CharType.ABS.ordinal] ||
|
overviewMenus.setting[g + 1][OverviewMenus.CharType.ABS.ordinal] ||
|
||||||
overviewMenus.setting[g + 1][OverviewMenus.CharType.DEVSLOPE.ordinal]
|
overviewMenus.setting[g + 1][OverviewMenus.CharType.DEVSLOPE.ordinal]
|
||||||
).toVisibility()
|
)).toVisibility()
|
||||||
secondaryGraphsData[g].performUpdate()
|
secondaryGraphsData[g].performUpdate()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,6 +30,7 @@ import info.nightscout.androidaps.interfaces.ProfileFunction;
|
||||||
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification;
|
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification;
|
||||||
import info.nightscout.androidaps.plugins.general.overview.notifications.Notification;
|
import info.nightscout.androidaps.plugins.general.overview.notifications.Notification;
|
||||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.data.AutosensData;
|
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.data.AutosensData;
|
||||||
|
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventAutosensBgLoaded;
|
||||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventAutosensCalculationFinished;
|
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventAutosensCalculationFinished;
|
||||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventIobCalculationProgress;
|
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventIobCalculationProgress;
|
||||||
import info.nightscout.androidaps.plugins.sensitivity.SensitivityAAPSPlugin;
|
import info.nightscout.androidaps.plugins.sensitivity.SensitivityAAPSPlugin;
|
||||||
|
@ -114,6 +115,7 @@ public class IobCobOref1Thread extends Thread {
|
||||||
if (bgDataReload) {
|
if (bgDataReload) {
|
||||||
iobCobCalculatorPlugin.loadBgData(end);
|
iobCobCalculatorPlugin.loadBgData(end);
|
||||||
iobCobCalculatorPlugin.createBucketedData();
|
iobCobCalculatorPlugin.createBucketedData();
|
||||||
|
rxBus.send(new EventAutosensBgLoaded(cause));
|
||||||
}
|
}
|
||||||
List<BgReading> bucketed_data = iobCobCalculatorPlugin.getBucketedData();
|
List<BgReading> bucketed_data = iobCobCalculatorPlugin.getBucketedData();
|
||||||
LongSparseArray<AutosensData> autosensDataTable = iobCobCalculatorPlugin.getAutosensDataTable();
|
LongSparseArray<AutosensData> autosensDataTable = iobCobCalculatorPlugin.getAutosensDataTable();
|
||||||
|
|
|
@ -28,6 +28,7 @@ import info.nightscout.androidaps.interfaces.ProfileFunction;
|
||||||
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification;
|
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification;
|
||||||
import info.nightscout.androidaps.plugins.general.overview.notifications.Notification;
|
import info.nightscout.androidaps.plugins.general.overview.notifications.Notification;
|
||||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.data.AutosensData;
|
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.data.AutosensData;
|
||||||
|
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventAutosensBgLoaded;
|
||||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventAutosensCalculationFinished;
|
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventAutosensCalculationFinished;
|
||||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventIobCalculationProgress;
|
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventIobCalculationProgress;
|
||||||
import info.nightscout.androidaps.plugins.sensitivity.SensitivityAAPSPlugin;
|
import info.nightscout.androidaps.plugins.sensitivity.SensitivityAAPSPlugin;
|
||||||
|
@ -111,6 +112,7 @@ public class IobCobThread extends Thread {
|
||||||
if (bgDataReload) {
|
if (bgDataReload) {
|
||||||
iobCobCalculatorPlugin.loadBgData(end);
|
iobCobCalculatorPlugin.loadBgData(end);
|
||||||
iobCobCalculatorPlugin.createBucketedData();
|
iobCobCalculatorPlugin.createBucketedData();
|
||||||
|
rxBus.send(new EventAutosensBgLoaded(cause));
|
||||||
}
|
}
|
||||||
List<BgReading> bucketed_data = iobCobCalculatorPlugin.getBucketedData();
|
List<BgReading> bucketed_data = iobCobCalculatorPlugin.getBucketedData();
|
||||||
LongSparseArray<AutosensData> autosensDataTable = iobCobCalculatorPlugin.getAutosensDataTable();
|
LongSparseArray<AutosensData> autosensDataTable = iobCobCalculatorPlugin.getAutosensDataTable();
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
package info.nightscout.androidaps.plugins.iob.iobCobCalculator.events
|
||||||
|
|
||||||
|
import info.nightscout.androidaps.events.Event
|
||||||
|
import info.nightscout.androidaps.events.EventLoop
|
||||||
|
|
||||||
|
class EventAutosensBgLoaded(var cause: Event) : EventLoop()
|
|
@ -79,6 +79,7 @@ class FabricPrivacy @Inject constructor(
|
||||||
try {
|
try {
|
||||||
val crashlytics = Crashlytics.getInstance()
|
val crashlytics = Crashlytics.getInstance()
|
||||||
crashlytics.core.logException(throwable)
|
crashlytics.core.logException(throwable)
|
||||||
|
aapsLogger.debug(LTag.CORE, "Exception: ", throwable)
|
||||||
} catch (e: NullPointerException) {
|
} catch (e: NullPointerException) {
|
||||||
aapsLogger.debug(LTag.CORE, "Ignoring opted out non-initialized log: $throwable")
|
aapsLogger.debug(LTag.CORE, "Ignoring opted out non-initialized log: $throwable")
|
||||||
} catch (e: IllegalStateException) {
|
} catch (e: IllegalStateException) {
|
||||||
|
|
Loading…
Reference in a new issue