fix cob scaling

This commit is contained in:
Milos Kozak 2018-04-20 12:28:07 +02:00
parent e1dc69cd4d
commit 0ab04c4d95
2 changed files with 11 additions and 2 deletions

View file

@ -15,6 +15,7 @@ import info.nightscout.androidaps.interfaces.PluginType;
import info.nightscout.androidaps.plugins.OpenAPSSMB.SMBDefaults;
import info.nightscout.androidaps.plugins.Overview.graphExtensions.DataPointWithLabelInterface;
import info.nightscout.androidaps.plugins.Overview.graphExtensions.PointsWithLabelGraphSeries;
import info.nightscout.androidaps.plugins.Overview.graphExtensions.Scale;
import info.nightscout.androidaps.plugins.SensitivityAAPS.SensitivityAAPSPlugin;
import info.nightscout.androidaps.plugins.SensitivityWeightedAverage.SensitivityWeightedAveragePlugin;
import info.nightscout.androidaps.plugins.Treatments.Treatment;
@ -112,6 +113,12 @@ public class AutosensData implements DataPointWithLabelInterface {
// ------- DataPointWithLabelInterface ------
private Scale scale;
public void setScale(Scale scale) {
this.scale = scale;
}
@Override
public double getX() {
return time;
@ -119,7 +126,7 @@ public class AutosensData implements DataPointWithLabelInterface {
@Override
public double getY() {
return cob;
return scale.transform(cob);
}
@Override

View file

@ -383,8 +383,10 @@ public class GraphData {
maxCobValueFound = Math.max(maxCobValueFound, cob);
lastCob = cob;
}
if (autosensData.failoverToMinAbsorbtionRate)
if (autosensData.failoverToMinAbsorbtionRate) {
autosensData.setScale(cobScale);
minFailoverActiveList.add(autosensData);
}
}
}