displaying therapy events optional
This commit is contained in:
parent
b06b65f692
commit
8fee28bcb7
|
@ -349,6 +349,8 @@ class HistoryBrowseActivity : NoSplashAppCompatActivity() {
|
|||
graphData.addBgReadings(menuChartSettings[0][OverviewMenus.CharType.PRE.ordinal])
|
||||
if (buildHelper.isDev()) graphData.addBucketedData()
|
||||
graphData.addTreatments()
|
||||
if (menuChartSettings[0][OverviewMenus.CharType.TREAT.ordinal])
|
||||
graphData.addTherapyEvents()
|
||||
if (menuChartSettings[0][OverviewMenus.CharType.ACT.ordinal])
|
||||
graphData.addActivity(0.8)
|
||||
if (pump.pumpDescription.isTempBasalCapable && menuChartSettings[0][OverviewMenus.CharType.BAS.ordinal])
|
||||
|
|
|
@ -263,6 +263,8 @@ class OverviewData @Inject constructor(
|
|||
|
||||
var maxTreatmentsValue = 0.0
|
||||
var treatmentsSeries: PointsWithLabelGraphSeries<DataPointWithLabelInterface> = PointsWithLabelGraphSeries()
|
||||
var maxTherapyEventValue = 0.0
|
||||
var therapyEventSeries: PointsWithLabelGraphSeries<DataPointWithLabelInterface> = PointsWithLabelGraphSeries()
|
||||
|
||||
var maxIobValueFound = Double.MIN_VALUE
|
||||
val iobScale = Scale()
|
||||
|
|
|
@ -943,6 +943,8 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList
|
|||
graphData.addBgReadings(menuChartSettings[0][OverviewMenus.CharType.PRE.ordinal])
|
||||
if (buildHelper.isDev()) graphData.addBucketedData()
|
||||
graphData.addTreatments()
|
||||
if (menuChartSettings[0][OverviewMenus.CharType.TREAT.ordinal])
|
||||
graphData.addTherapyEvents()
|
||||
if (menuChartSettings[0][OverviewMenus.CharType.ACT.ordinal])
|
||||
graphData.addActivity(0.8)
|
||||
if ((pump.pumpDescription.isTempBasalCapable || config.NSCLIENT) && menuChartSettings[0][OverviewMenus.CharType.BAS.ordinal])
|
||||
|
|
|
@ -36,6 +36,7 @@ class OverviewMenus @Inject constructor(
|
|||
) {
|
||||
enum class CharType(@StringRes val nameId: Int, @AttrRes val attrId: Int, val primary: Boolean, val secondary: Boolean, @StringRes val shortnameId: Int) {
|
||||
PRE(R.string.overview_show_predictions, R.attr.predictionColor, primary = true, secondary = false, shortnameId = R.string.prediction_shortname),
|
||||
TREAT(R.string.overview_show_treatments, R.attr.predictionColor, primary = true, secondary = false, shortnameId = R.string.treatments_shortname),
|
||||
BAS(R.string.overview_show_basals, R.attr.basal, primary = true, secondary = false,shortnameId = R.string.basal_shortname),
|
||||
ABS(R.string.overview_show_absinsulin, R.attr.iobColor, primary = false, secondary = true,shortnameId = R.string.abs_insulin_shortname),
|
||||
IOB(R.string.overview_show_iob, R.attr.iobColor, primary = false, secondary = true,shortnameId = R.string.iob),
|
||||
|
|
|
@ -88,6 +88,11 @@ class GraphData(
|
|||
addSeries(overviewData.treatmentsSeries)
|
||||
}
|
||||
|
||||
fun addTherapyEvents() {
|
||||
maxY = maxOf(maxY, overviewData.maxTherapyEventValue)
|
||||
addSeries(overviewData.therapyEventSeries)
|
||||
}
|
||||
|
||||
fun addActivity(scale: Double) {
|
||||
addSeries(overviewData.activitySeries)
|
||||
addSeries(overviewData.activityPredictionSeries)
|
||||
|
|
|
@ -54,6 +54,8 @@ class PrepareTreatmentsDataWorker(
|
|||
rxBus.send(EventIobCalculationProgress(CalculationWorkflow.ProgressData.PREPARE_TREATMENTS_DATA, 0, null))
|
||||
data.overviewData.maxTreatmentsValue = 0.0
|
||||
val filteredTreatments: MutableList<DataPointWithLabelInterface> = ArrayList()
|
||||
val filteredTherapyEvents: MutableList<DataPointWithLabelInterface> = ArrayList()
|
||||
|
||||
repository.getBolusesDataFromTimeToTime(data.overviewData.fromTime, data.overviewData.endTime, true).blockingGet()
|
||||
.map { BolusDataPoint(it, rh, activePlugin, defaultValueHelper) }
|
||||
.filter { it.data.type == Bolus.Type.NORMAL || it.data.type == Bolus.Type.SMB }
|
||||
|
@ -102,7 +104,7 @@ class PrepareTreatmentsDataWorker(
|
|||
.filterTimeframe(data.overviewData.fromTime, data.overviewData.endTime)
|
||||
.forEach {
|
||||
if (it.y == 0.0) it.y = getNearestBg(data.overviewData, it.x.toLong())
|
||||
filteredTreatments.add(it)
|
||||
filteredTherapyEvents.add(it)
|
||||
}
|
||||
|
||||
// increase maxY if a treatment forces it's own height that's higher than a BG value
|
||||
|
@ -110,8 +112,13 @@ class PrepareTreatmentsDataWorker(
|
|||
.maxOrNull()
|
||||
?.let(::addUpperChartMargin)
|
||||
?.let { data.overviewData.maxTreatmentsValue = maxOf(data.overviewData.maxTreatmentsValue, it) }
|
||||
filteredTherapyEvents.map { it.y }
|
||||
.maxOrNull()
|
||||
?.let(::addUpperChartMargin)
|
||||
?.let { data.overviewData.maxTherapyEventValue = maxOf(data.overviewData.maxTherapyEventValue, it) }
|
||||
|
||||
data.overviewData.treatmentsSeries = PointsWithLabelGraphSeries(filteredTreatments.toTypedArray())
|
||||
data.overviewData.therapyEventSeries = PointsWithLabelGraphSeries(filteredTherapyEvents.toTypedArray())
|
||||
|
||||
rxBus.send(EventIobCalculationProgress(CalculationWorkflow.ProgressData.PREPARE_TREATMENTS_DATA, 100, null))
|
||||
return Result.success()
|
||||
|
|
|
@ -997,6 +997,7 @@
|
|||
<string name="smscommunicator_otp_install_info">On each follower phone install Authenticator app that support RFC 6238 TOTP tokens. Popular free apps are:\n • Authy\n • Google Authenticator\n • LastPass Authenticator\n • FreeOTP Authenticator</string>
|
||||
<string name="smscommunicator_otp_reset_warning">By reseting authenticator you make all already provisioned authenticators invalid. You will need to set up them again!</string>
|
||||
<string name="overview_show_predictions">Predictions</string>
|
||||
<string name="overview_show_treatments">Treatments</string>
|
||||
<string name="overview_show_deviationslope">Deviation slope</string>
|
||||
<string name="key_graphconfig" translatable="false">graphconfig</string>
|
||||
<string name="authorizationfailed">Authorization failed</string>
|
||||
|
|
Loading…
Reference in a new issue