Skip to content

Commit

Permalink
Jumping Resistance on Schwinn IC8 (Issue #1236)
Browse files Browse the repository at this point in the history
  • Loading branch information
cagnulein committed Feb 8, 2023
1 parent 5d1b399 commit 8ec7608
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/schwinnic4bike.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,18 +316,18 @@ void schwinnic4bike::characteristicChanged(const QLowEnergyCharacteristic &chara
settings.value(QZSettings::peloton_offset, QZSettings::default_peloton_offset).toDouble();

double resistance;
if (isnan(res)) {
res = 0;
}
if (settings.value(QZSettings::schwinn_bike_resistance, QZSettings::default_schwinn_bike_resistance).toBool())
resistance = pelotonToBikeResistance(m_pelotonResistance.value());
resistance = pelotonToBikeResistance(res);
else
resistance = m_pelotonResistance.value();
resistance = res;
if (qFabs(resistance - Resistance.value()) >=
(double)settings.value(QZSettings::schwinn_resistance_smooth, QZSettings::default_schwinn_resistance_smooth)
.toInt()) {
Resistance = resistance;
if (isnan(res))
m_pelotonResistance = 0;
else
m_pelotonResistance = res;
m_pelotonResistance = res;
} else {
// to calculate correctly the averages
Resistance = Resistance.value();
Expand Down

0 comments on commit 8ec7608

Please sign in to comment.