Skip to content

Commit

Permalink
Use user determined power gain values with Stryd and Incline #1765
Browse files Browse the repository at this point in the history
reverting #1741
  • Loading branch information
cagnulein committed Nov 2, 2023
1 parent 98fbd64 commit 96c80d5
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions src/treadmill.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,17 +176,7 @@ double treadmill::requestedInclination() { return requestInclination; }
double treadmill::currentTargetSpeed() { return targetSpeed; }

void treadmill::cadenceSensor(uint8_t cadence) { Cadence.setValue(cadence); }
void treadmill::powerSensor(uint16_t power) {
double vwatts = 0;
if(currentInclination().value() != 0) {
QSettings settings;
double w = settings.value(QZSettings::weight, QZSettings::default_weight).toFloat();
// calc Watts ref. https://alancouzens.com/blog/Run_Power.html
vwatts = ((9.8 * w) * (currentInclination().value() / 100.0));
qDebug() << QStringLiteral("overrding power read from the sensor of ") << power << QStringLiteral("with ") << vwatts << QStringLiteral(" for the treadmill inclination");
}
m_watt.setValue(power + vwatts, false);
}
void treadmill::powerSensor(uint16_t power) { m_watt.setValue(power, false); }
void treadmill::speedSensor(double speed) { Speed.setValue(speed); }
void treadmill::instantaneousStrideLengthSensor(double length) { InstantaneousStrideLengthCM.setValue(length); }
void treadmill::groundContactSensor(double groundContact) { GroundContactMS.setValue(groundContact); }
Expand Down

0 comments on commit 96c80d5

Please sign in to comment.