Skip to content
Commit e6fdb5b1 authored by Stefan Brüns's avatar Stefan Brüns
Browse files

Fix and consolidate discharge rate and remaining time calculation

This fixes several issues in the current code:
1. Instead of averaging the remaining time it averages the discharge rate,
   and uses the rate and remaining energy to calculate the time.
2. It gets rid of the history array, an autoregressive filter only needs
   one history value, no point recalculating it again and again.
3. It keeps the averaged discharge rate over plug/unplug events. This
   reduces the error after replugging, as the first few reported rate
   values are often too small, while there is no intrinsic reason the
   old rate estimate becomes invalid.
4. It brings the legacy remaining time calculation in line with the one
   based on the DisplayDevice UPower object, i.e. always uses rate and
   remaining energy to full/empty to calculate the time.

CCBUG: 434432
parent db927a7d
Pipeline #382288 passed with stage
in 2 minutes and 12 seconds
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment