remove IOB AS=1 prediction

This commit is contained in:
Milos Kozak 2021-11-15 23:30:53 +01:00
parent d0e9761e70
commit 3e6aa56e94
3 changed files with 12 additions and 6 deletions

View file

@ -81,7 +81,7 @@ class OverviewData @Inject constructor(
iobSeries = FixedLineGraphSeries() iobSeries = FixedLineGraphSeries()
absIobSeries = FixedLineGraphSeries() absIobSeries = FixedLineGraphSeries()
iobPredictions1Series = PointsWithLabelGraphSeries() iobPredictions1Series = PointsWithLabelGraphSeries()
iobPredictions2Series = PointsWithLabelGraphSeries() //iobPredictions2Series = PointsWithLabelGraphSeries()
minusBgiSeries = FixedLineGraphSeries() minusBgiSeries = FixedLineGraphSeries()
minusBgiHistSeries = FixedLineGraphSeries() minusBgiHistSeries = FixedLineGraphSeries()
cobSeries = FixedLineGraphSeries() cobSeries = FixedLineGraphSeries()
@ -265,7 +265,7 @@ class OverviewData @Inject constructor(
var iobSeries: FixedLineGraphSeries<ScaledDataPoint> = FixedLineGraphSeries() var iobSeries: FixedLineGraphSeries<ScaledDataPoint> = FixedLineGraphSeries()
var absIobSeries: FixedLineGraphSeries<ScaledDataPoint> = FixedLineGraphSeries() var absIobSeries: FixedLineGraphSeries<ScaledDataPoint> = FixedLineGraphSeries()
var iobPredictions1Series: PointsWithLabelGraphSeries<DataPointWithLabelInterface> = PointsWithLabelGraphSeries() var iobPredictions1Series: PointsWithLabelGraphSeries<DataPointWithLabelInterface> = PointsWithLabelGraphSeries()
var iobPredictions2Series: PointsWithLabelGraphSeries<DataPointWithLabelInterface> = PointsWithLabelGraphSeries() //var iobPredictions2Series: PointsWithLabelGraphSeries<DataPointWithLabelInterface> = PointsWithLabelGraphSeries()
var maxBGIValue = Double.MIN_VALUE var maxBGIValue = Double.MIN_VALUE
val bgiScale = Scale() val bgiScale = Scale()
@ -724,6 +724,8 @@ class OverviewData @Inject constructor(
maxIobValueFound = max(maxIobValueFound, abs(i.iob)) maxIobValueFound = max(maxIobValueFound, abs(i.iob))
} }
iobPredictions1Series = PointsWithLabelGraphSeries(Array(iobPrediction.size) { i -> iobPrediction[i] }) iobPredictions1Series = PointsWithLabelGraphSeries(Array(iobPrediction.size) { i -> iobPrediction[i] })
aapsLogger.debug(LTag.AUTOSENS, "IOB prediction for AS=" + DecimalFormatter.to2Decimal(lastAutosensResult.ratio) + ": " + iobCobCalculator.iobArrayToString(iobPredictionArray))
/*
val iobPrediction2: MutableList<DataPointWithLabelInterface> = java.util.ArrayList() val iobPrediction2: MutableList<DataPointWithLabelInterface> = java.util.ArrayList()
val iobPredictionArray2 = iobCobCalculator.calculateIobArrayForSMB(AutosensResult(), SMBDefaults.exercise_mode, SMBDefaults.half_basal_exercise_target, isTempTarget) val iobPredictionArray2 = iobCobCalculator.calculateIobArrayForSMB(AutosensResult(), SMBDefaults.exercise_mode, SMBDefaults.half_basal_exercise_target, isTempTarget)
for (i in iobPredictionArray2) { for (i in iobPredictionArray2) {
@ -731,11 +733,11 @@ class OverviewData @Inject constructor(
maxIobValueFound = max(maxIobValueFound, abs(i.iob)) maxIobValueFound = max(maxIobValueFound, abs(i.iob))
} }
iobPredictions2Series = PointsWithLabelGraphSeries(Array(iobPrediction2.size) { i -> iobPrediction2[i] }) iobPredictions2Series = PointsWithLabelGraphSeries(Array(iobPrediction2.size) { i -> iobPrediction2[i] })
aapsLogger.debug(LTag.AUTOSENS, "IOB prediction for AS=" + DecimalFormatter.to2Decimal(lastAutosensResult.ratio) + ": " + iobCobCalculator.iobArrayToString(iobPredictionArray))
aapsLogger.debug(LTag.AUTOSENS, "IOB prediction for AS=" + DecimalFormatter.to2Decimal(1.0) + ": " + iobCobCalculator.iobArrayToString(iobPredictionArray2)) aapsLogger.debug(LTag.AUTOSENS, "IOB prediction for AS=" + DecimalFormatter.to2Decimal(1.0) + ": " + iobCobCalculator.iobArrayToString(iobPredictionArray2))
*/
} else { } else {
iobPredictions1Series = PointsWithLabelGraphSeries() iobPredictions1Series = PointsWithLabelGraphSeries()
iobPredictions2Series = PointsWithLabelGraphSeries() //iobPredictions2Series = PointsWithLabelGraphSeries()
} }
// COB // COB

View file

@ -394,7 +394,11 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList
} else if (dexcomPlugin.isEnabled()) { } else if (dexcomPlugin.isEnabled()) {
try { try {
dexcomMediator.findDexcomPackageName()?.let { dexcomMediator.findDexcomPackageName()?.let {
startActivity(Intent("com.dexcom.cgm.activities.MeterEntryActivity").setPackage(it)) startActivity(
Intent("com.dexcom.cgm.activities.MeterEntryActivity")
.setPackage(it)
.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
)
} }
?: ToastUtils.showToastInUiThread(activity, rh.gs(R.string.dexcom_app_not_installed)) ?: ToastUtils.showToastInUiThread(activity, rh.gs(R.string.dexcom_app_not_installed))
} catch (e: ActivityNotFoundException) { } catch (e: ActivityNotFoundException) {

View file

@ -114,7 +114,7 @@ class GraphData(
overviewData.iobScale.multiplier = maxY * scale / overviewData.maxIobValueFound overviewData.iobScale.multiplier = maxY * scale / overviewData.maxIobValueFound
addSeries(overviewData.iobSeries) addSeries(overviewData.iobSeries)
addSeries(overviewData.iobPredictions1Series) addSeries(overviewData.iobPredictions1Series)
addSeries(overviewData.iobPredictions2Series) //addSeries(overviewData.iobPredictions2Series)
} }
// scale in % of vertical size (like 0.3) // scale in % of vertical size (like 0.3)