Convert status Message to Kotlin (+ associated null management in localInsightPlugin)
This commit is contained in:
parent
ea940ea165
commit
37bd7495fd
|
@ -268,7 +268,7 @@ class OverviewData @Inject constructor(
|
||||||
|
|
||||||
var maxRatioValueFound = 5.0 //even if sens data equals 0 for all the period, minimum scale is between 95% and 105%
|
var maxRatioValueFound = 5.0 //even if sens data equals 0 for all the period, minimum scale is between 95% and 105%
|
||||||
var minRatioValueFound = -maxRatioValueFound
|
var minRatioValueFound = -maxRatioValueFound
|
||||||
val ratioScale = Scale()
|
var ratioScale = Scale()
|
||||||
var ratioSeries: LineGraphSeries<ScaledDataPoint> = LineGraphSeries()
|
var ratioSeries: LineGraphSeries<ScaledDataPoint> = LineGraphSeries()
|
||||||
|
|
||||||
var maxFromMaxValueFound = Double.MIN_VALUE
|
var maxFromMaxValueFound = Double.MIN_VALUE
|
||||||
|
|
|
@ -15,6 +15,7 @@ import info.nightscout.androidaps.logging.AAPSLogger
|
||||||
import info.nightscout.androidaps.plugins.general.overview.OverviewData
|
import info.nightscout.androidaps.plugins.general.overview.OverviewData
|
||||||
import info.nightscout.androidaps.plugins.general.overview.graphExtensions.AreaGraphSeries
|
import info.nightscout.androidaps.plugins.general.overview.graphExtensions.AreaGraphSeries
|
||||||
import info.nightscout.androidaps.plugins.general.overview.graphExtensions.DoubleDataPoint
|
import info.nightscout.androidaps.plugins.general.overview.graphExtensions.DoubleDataPoint
|
||||||
|
import info.nightscout.androidaps.plugins.general.overview.graphExtensions.Scale
|
||||||
import info.nightscout.androidaps.plugins.general.overview.graphExtensions.TimeAsXAxisLabelFormatter
|
import info.nightscout.androidaps.plugins.general.overview.graphExtensions.TimeAsXAxisLabelFormatter
|
||||||
import info.nightscout.androidaps.utils.DefaultValueHelper
|
import info.nightscout.androidaps.utils.DefaultValueHelper
|
||||||
import info.nightscout.androidaps.utils.Round
|
import info.nightscout.androidaps.utils.Round
|
||||||
|
@ -153,9 +154,12 @@ class GraphData(
|
||||||
if (useForScale) {
|
if (useForScale) {
|
||||||
maxY = 100.0 + max(overviewData.maxRatioValueFound, abs(overviewData.minRatioValueFound))
|
maxY = 100.0 + max(overviewData.maxRatioValueFound, abs(overviewData.minRatioValueFound))
|
||||||
minY = 100.0 - max(overviewData.maxRatioValueFound, abs(overviewData.minRatioValueFound))
|
minY = 100.0 - max(overviewData.maxRatioValueFound, abs(overviewData.minRatioValueFound))
|
||||||
|
overviewData.ratioScale = Scale(100.0)
|
||||||
overviewData.ratioScale.setMultiplier(1.0)
|
overviewData.ratioScale.setMultiplier(1.0)
|
||||||
} else
|
} else {
|
||||||
|
overviewData.ratioScale = Scale()
|
||||||
overviewData.ratioScale.setMultiplier(maxY * scale / max(overviewData.maxRatioValueFound, abs(overviewData.minRatioValueFound)))
|
overviewData.ratioScale.setMultiplier(maxY * scale / max(overviewData.maxRatioValueFound, abs(overviewData.minRatioValueFound)))
|
||||||
|
}
|
||||||
addSeries(overviewData.ratioSeries)
|
addSeries(overviewData.ratioSeries)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue