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

View file

@ -383,10 +383,12 @@ public class GraphData {
maxCobValueFound = Math.max(maxCobValueFound, cob); maxCobValueFound = Math.max(maxCobValueFound, cob);
lastCob = cob; lastCob = cob;
} }
if (autosensData.failoverToMinAbsorbtionRate) if (autosensData.failoverToMinAbsorbtionRate) {
autosensData.setScale(cobScale);
minFailoverActiveList.add(autosensData); minFailoverActiveList.add(autosensData);
} }
} }
}
// COB // COB
ScaledDataPoint[] cobData = new ScaledDataPoint[cobArray.size()]; ScaledDataPoint[] cobData = new ScaledDataPoint[cobArray.size()];