Smooting: use recalculated in watch graph

This commit is contained in:
Milos Kozak 2022-12-26 11:10:42 +01:00
parent 0f5d3b5813
commit 1b338b30ab
3 changed files with 4 additions and 4 deletions

View file

@ -115,7 +115,7 @@ class DataBroadcastPlugin @Inject constructor(
val lastBG = iobCobCalculator.ads.lastBg() ?: return
val glucoseStatus = glucoseStatusProvider.glucoseStatusData ?: return
bundle.putDouble("glucoseMgdl", lastBG.value) // last BG in mgdl
bundle.putDouble("glucoseMgdl", lastBG.recalculated) // last BG in mgdl
bundle.putLong("glucoseTimeStamp", lastBG.timestamp) // timestamp
bundle.putString("units", profileFunction.getUnits().asText) // units used in AAPS "mg/dl" or "mmol"
bundle.putString("slopeArrow", lastBG.trendArrow.text) // direction arrow as string

View file

@ -948,8 +948,8 @@ class DataHandlerMobile @Inject constructor(
slopeArrow = trendCalculator.getTrendArrow(glucoseValue).symbol,
delta = glucoseStatus?.let { deltaString(it.delta, it.delta * Constants.MGDL_TO_MMOLL, units) } ?: "--",
avgDelta = glucoseStatus?.let { deltaString(it.shortAvgDelta, it.shortAvgDelta * Constants.MGDL_TO_MMOLL, units) } ?: "--",
sgvLevel = if (glucoseValue.value > highLine) 1L else if (glucoseValue.value < lowLine) -1L else 0L,
sgv = glucoseValue.value,
sgvLevel = if (glucoseValue.recalculated > highLine) 1L else if (glucoseValue.recalculated < lowLine) -1L else 0L,
sgv = glucoseValue.recalculated,
high = highLine,
low = lowLine,
color = 0

View file

@ -192,7 +192,7 @@ class CarbsDialog : DialogFragmentWithDate() {
}
iobCobCalculator.ads.actualBg()?.let { bgReading ->
if (bgReading.value < 72)
if (bgReading.recalculated < 72)
binding.hypoTt.isChecked = true
}
binding.hypoTt.setOnClickListener {