Repository navigation
HeartBadPointFilter
Up | Previous | Next | Русский
Below is the full source of the class in documentation form. The comments inside the block explain the purpose of the parts of the class, but they are not stored in the working file HeartBadPointFilter.java: the production code stays clean and the explanations live in the wiki.
package com.velitask.plugin.official.processing.filters;
import com.velitask.sdk.data.HeartSensorAtom;
/* Bad heart rate points. */
public final class HeartBadPointFilter extends BadPointFilter<HeartSensorAtom> {
/* Stable step name in plans and settings. */
public static final String NAME = "heartBadPoint";
public HeartBadPointFilter() {
/* Step version 1; the sensor atom is HeartSensorAtom. */
super(NAME, 1, HeartSensorAtom.class);
}
@Override
/* Heart rate value, bpm. */
protected double value(HeartSensorAtom atom) {
return atom.hr;
}
}HeartBadPointFilter is the "Bad heart rate points" filter for the HeartSensorAtom sensor. It rejects values that cannot be trusted: right after a pause, outside the limits, with a too fast jump or a single spike. The whole algorithm and the ten parameters are in the base class BadPointFilter; the class only binds it to the atom.
-
Name and version:
heartBadPoint, version 1. -
valueis thehrfield of the atom without conversion (bpm). The parameters in sensor units (min,max,deviation,floor) are set in beats per minute;maxRateis in these units per hour.
Where it is used. The step is registered in BuiltinScenarios. In FitImportPlan it is the first step of the heart rate sensor: useRange = true, min = 1, max = 220: values outside 1-220 bpm are rejected. It is not used in the other built-in plans.
- By default all parameters are off (0 or
false) and the filter removes nothing; the values are set by the import plans, the user can change them in the step settings. - The "Check the limits" checkbox without set limits will reject all values except zero (
min = max = 0by default). - The other features (the order of the checks, the comparison with the last accepted point, the median window of spikes) are in BadPointFilter.