Skip to content

CyclingPowerBadPointFilter

roosit edited this page Nov 15, 2026 · 1 revision

CyclingPowerBadPointFilter

Up | Previous | Next | Русский

Full source with short explanations

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 CyclingPowerBadPointFilter.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.CyclingPowerSensorAtom;

/* Bad power points. */
public final class CyclingPowerBadPointFilter extends BadPointFilter<CyclingPowerSensorAtom> {

    /* Stable step name in plans and settings. */
    public static final String NAME = "cyclingPowerBadPoint";

    public CyclingPowerBadPointFilter() {
        /* Step version 1; the sensor atom is CyclingPowerSensorAtom. */
        super(NAME, 1, CyclingPowerSensorAtom.class);
    }

    @Override
    /* Power, W. */
    protected double value(CyclingPowerSensorAtom atom) {
        return atom.power;
    }
}

Purpose

CyclingPowerBadPointFilter is the "Bad power points" filter for the CyclingPowerSensorAtom 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.

How it works

  • Name and version: cyclingPowerBadPoint, version 1.
  • value is the power field of the atom without conversion (W). The parameters in sensor units (min, max, deviation, floor) are set in watts; maxRate is in these units per hour.

Where it is used. The step is registered in BuiltinScenarios. In FitImportPlan it is the first step of the power sensor: the limits are not turned on, but the spike search is set up: windowSec = 5, deviation = 1000, floor = 1500. A value of 1500 W or higher that differs from the median of a 5-second window by 1000 W or more is rejected.

Features and limitations

  • 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 = 0 by default).
  • The other features (the order of the checks, the comparison with the last accepted point, the median window of spikes) are in BadPointFilter.

Clone this wiki locally