Skip to content

PowerBalanceBadPointFilter

roosit edited this page Nov 15, 2026 · 1 revision

PowerBalanceBadPointFilter

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 PowerBalanceBadPointFilter.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.PowerBalanceSensorAtom;

/* Bad power balance points. */
public final class PowerBalanceBadPointFilter extends BadPointFilter<PowerBalanceSensorAtom> {

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

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

    @Override
    /* Share of the right leg's power, %. */
    protected double value(PowerBalanceSensorAtom atom) {
        return atom.rightPercent;
    }
}

Purpose

PowerBalanceBadPointFilter is the "Bad power balance points" filter for the PowerBalanceSensorAtom 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: powerBalanceBadPoint, version 1.
  • value is the rightPercent field of the atom (the share of the right leg, %); the share of the left leg is not checked separately. The parameters in sensor units (min, max, deviation, floor) are set in percent; 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 balance sensor: useRange = true, min = 0, max = 100.

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