fix adding zero deviations
This commit is contained in:
parent
9c5e389afb
commit
53ba6d46d5
4 changed files with 14 additions and 10 deletions
|
@ -105,12 +105,13 @@ public class SensitivityAAPSPlugin extends PluginBase implements SensitivityInte
|
||||||
pastSensitivity += "(SITECHANGE)";
|
pastSensitivity += "(SITECHANGE)";
|
||||||
}
|
}
|
||||||
|
|
||||||
double deviation = autosensData.validDeviation ? autosensData.deviation : 0d;
|
double deviation = autosensData.deviation;
|
||||||
|
|
||||||
//set positive deviations to zero if bg < 80
|
//set positive deviations to zero if bg < 80
|
||||||
if (autosensData.bg < 80 && deviation > 0)
|
if (autosensData.bg < 80 && deviation > 0)
|
||||||
deviation = 0;
|
deviation = 0;
|
||||||
|
|
||||||
|
if (autosensData.validDeviation)
|
||||||
if (autosensData.time > toTime - hoursForDetection * 60 * 60 * 1000L)
|
if (autosensData.time > toTime - hoursForDetection * 60 * 60 * 1000L)
|
||||||
deviationsArray.add(deviation);
|
deviationsArray.add(deviation);
|
||||||
if (deviationsArray.size() > hoursForDetection * 60 / 5)
|
if (deviationsArray.size() > hoursForDetection * 60 / 5)
|
||||||
|
|
|
@ -106,12 +106,13 @@ public class SensitivityOref0Plugin extends PluginBase implements SensitivityInt
|
||||||
pastSensitivity += "(SITECHANGE)";
|
pastSensitivity += "(SITECHANGE)";
|
||||||
}
|
}
|
||||||
|
|
||||||
double deviation = autosensData.validDeviation ? autosensData.deviation : 0d;
|
double deviation = autosensData.deviation;
|
||||||
|
|
||||||
//set positive deviations to zero if bg < 80
|
//set positive deviations to zero if bg < 80
|
||||||
if (autosensData.bg < 80 && deviation > 0)
|
if (autosensData.bg < 80 && deviation > 0)
|
||||||
deviation = 0;
|
deviation = 0;
|
||||||
|
|
||||||
|
if (autosensData.validDeviation)
|
||||||
if (autosensData.time > toTime - hoursForDetection * 60 * 60 * 1000L)
|
if (autosensData.time > toTime - hoursForDetection * 60 * 60 * 1000L)
|
||||||
deviationsArray.add(deviation);
|
deviationsArray.add(deviation);
|
||||||
if (deviationsArray.size() > hoursForDetection * 60 / 5)
|
if (deviationsArray.size() > hoursForDetection * 60 / 5)
|
||||||
|
|
|
@ -97,12 +97,13 @@ public class SensitivityOref1Plugin extends PluginBase implements SensitivityInt
|
||||||
pastSensitivity += "(SITECHANGE)";
|
pastSensitivity += "(SITECHANGE)";
|
||||||
}
|
}
|
||||||
|
|
||||||
double deviation = autosensData.validDeviation ? autosensData.deviation : 0d;
|
double deviation = autosensData.deviation;
|
||||||
|
|
||||||
//set positive deviations to zero if bg < 80
|
//set positive deviations to zero if bg < 80
|
||||||
if (autosensData.bg < 80 && deviation > 0)
|
if (autosensData.bg < 80 && deviation > 0)
|
||||||
deviation = 0;
|
deviation = 0;
|
||||||
|
|
||||||
|
if (autosensData.validDeviation)
|
||||||
deviationsArray.add(deviation);
|
deviationsArray.add(deviation);
|
||||||
|
|
||||||
for (int i = 0; i < autosensData.extraDeviation.size(); i++)
|
for (int i = 0; i < autosensData.extraDeviation.size(); i++)
|
||||||
|
|
|
@ -111,7 +111,7 @@ public class SensitivityWeightedAveragePlugin extends PluginBase implements Sens
|
||||||
pastSensitivity += "(SITECHANGE)";
|
pastSensitivity += "(SITECHANGE)";
|
||||||
}
|
}
|
||||||
|
|
||||||
double deviation = autosensData.validDeviation ? autosensData.deviation : 0d;
|
double deviation = autosensData.deviation;
|
||||||
|
|
||||||
//set positive deviations to zero if bg < 80
|
//set positive deviations to zero if bg < 80
|
||||||
if (autosensData.bg < 80 && deviation > 0)
|
if (autosensData.bg < 80 && deviation > 0)
|
||||||
|
@ -119,6 +119,7 @@ public class SensitivityWeightedAveragePlugin extends PluginBase implements Sens
|
||||||
|
|
||||||
//data.append(autosensData.time);
|
//data.append(autosensData.time);
|
||||||
long reverseWeight = (toTime - autosensData.time) / (5 * 60 * 1000L);
|
long reverseWeight = (toTime - autosensData.time) / (5 * 60 * 1000L);
|
||||||
|
if (autosensData.validDeviation)
|
||||||
data.append(reverseWeight, deviation);
|
data.append(reverseWeight, deviation);
|
||||||
//weights += reverseWeight;
|
//weights += reverseWeight;
|
||||||
//weightedsum += reverseWeight * (autosensData.validDeviation ? autosensData.deviation : 0d);
|
//weightedsum += reverseWeight * (autosensData.validDeviation ? autosensData.deviation : 0d);
|
||||||
|
|
Loading…
Reference in a new issue