Merge pull request #2731 from Philoul/wear/Bolus_Carbs_Overlap

Reduce overlap between Carbs and Bolus in Wear graphs
This commit is contained in:
Milos Kozak 2023-09-04 10:14:05 +02:00 committed by GitHub
commit 610e074f40
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -139,7 +139,7 @@ class BgGraphBuilder(
val pointValues: MutableList<PointValue> = ArrayList()
for ((date, bolus, _, isSMB, isValid) in bolusWatchDataList) {
if (date in (startingTime + 1)..endingTime && !isSMB && isValid && bolus > 0) {
pointValues.add(PointValue(fuzz(date), offset - 2))
pointValues.add(PointValue(fuzz(date), offset - pointSize * 3))
}
}
return Line(pointValues).also { line ->
@ -154,7 +154,7 @@ class BgGraphBuilder(
val pointValues: MutableList<PointValue> = ArrayList()
for ((date, bolus, _, isSMB, isValid) in bolusWatchDataList) {
if (date in (startingTime + 1)..endingTime && isSMB && isValid && bolus > 0) {
pointValues.add(PointValue(fuzz(date), offset - 2))
pointValues.add(PointValue(fuzz(date), offset - pointSize * 3))
}
}
return Line(pointValues).also { line ->
@ -169,7 +169,7 @@ class BgGraphBuilder(
val pointValues: MutableList<PointValue> = ArrayList()
for ((date, bolus, carbs, _, isValid) in bolusWatchDataList) {
if (date in (startingTime + 1)..endingTime && !(isValid && (bolus > 0 || carbs > 0))) {
pointValues.add(PointValue(fuzz(date), offset - 2))
pointValues.add(PointValue(fuzz(date), offset - pointSize * 3))
}
}
return Line(pointValues).also { line ->
@ -184,7 +184,7 @@ class BgGraphBuilder(
val pointValues: MutableList<PointValue> = ArrayList()
for ((date, _, carbs, isSMB, isValid) in bolusWatchDataList) {
if (date in (startingTime + 1)..endingTime && !isSMB && isValid && carbs > 0) {
pointValues.add(PointValue(fuzz(date), offset + 2))
pointValues.add(PointValue(fuzz(date), offset + pointSize * 3))
}
}
return Line(pointValues).also { line ->