diff --git a/src/devices/bluetoothdevice.cpp b/src/devices/bluetoothdevice.cpp index 73ce49e97..972ad1513 100644 --- a/src/devices/bluetoothdevice.cpp +++ b/src/devices/bluetoothdevice.cpp @@ -169,7 +169,7 @@ void bluetoothdevice::setVirtualDevice(virtualdevice *virtualDevice, VIRTUAL_DEV } // keiser m3i has a separate management of this, so please check it -void bluetoothdevice::update_metrics(bool watt_calc, const double watts, const bool from_accessory, double resistance) { +void bluetoothdevice::update_metrics(bool watt_calc, const double watts, const bool from_accessory) { QDateTime current = QDateTime::currentDateTime(); double deltaTime = (((double)_lastTimeUpdate.msecsTo(current)) / ((double)1000.0)); @@ -188,7 +188,7 @@ void bluetoothdevice::update_metrics(bool watt_calc, const double watts, const b watt_calc = false; if(deviceType() == bluetoothdevice::BIKE && !from_accessory) // append only if it's coming from the bike, not from the power sensor - _ergTable.collectData(Cadence.value(), m_watt.value(), resistance); + _ergTable.collectData(Cadence.value(), m_watt.value(), Resistance.value()); if (!_firstUpdate && !paused) { if (currentSpeed().value() > 0.0 || settings.value(QZSettings::continuous_moving, true).toBool()) { diff --git a/src/devices/bluetoothdevice.h b/src/devices/bluetoothdevice.h index 338773aa1..b8d91c609 100644 --- a/src/devices/bluetoothdevice.h +++ b/src/devices/bluetoothdevice.h @@ -710,7 +710,7 @@ class bluetoothdevice : public QObject { * @param watt_calc ?? * @param watts ?. Unit: watts */ - void update_metrics(bool watt_calc, const double watts, const bool from_accessory = false, double resistance = Resistance.value()); + void update_metrics(bool watt_calc, const double watts, const bool from_accessory = false); /** * @brief update_hr_from_external Updates heart rate from Garmin Companion App or Apple Watch diff --git a/src/devices/ftmsbike/ftmsbike.cpp b/src/devices/ftmsbike/ftmsbike.cpp index ae9079536..7f07a00f6 100644 --- a/src/devices/ftmsbike/ftmsbike.cpp +++ b/src/devices/ftmsbike/ftmsbike.cpp @@ -264,8 +264,7 @@ void ftmsbike::update() { // gattWriteCharacteristic.isValid() && // gattNotify1Characteristic.isValid() && /*initDone*/) { - // here the bike that doesn't have ERG mode, so i'm using inclination to recreate a resistance value - update_metrics(false, watts(), false, (VFSPINBIKE ? Inclination.value() * 10.0 : Resistance.value())); + update_metrics(false, watts()); // updating the treadmill console every second if (sec1Update++ == (500 / refresh->interval())) { @@ -363,11 +362,9 @@ void ftmsbike::update() { lastGearValue = gears(); if (requestPower != -1) { - if(!VFSPINBIKE) { // this bike doesn't handle ERG mode - qDebug() << QStringLiteral("writing power") << requestPower; - init(); - forcePower(requestPower); - } + qDebug() << QStringLiteral("writing power") << requestPower; + init(); + forcePower(requestPower); requestPower = -1; } if (requestStart != -1) { @@ -1114,12 +1111,6 @@ void ftmsbike::ftmsCharacteristicChanged(const QLowEnergyCharacteristic &charact b[1] = power & 0xFF; b[2] = power >> 8; qDebug() << "applying gears mod" << gears() << gearsZwiftRatio() << power; - - // this bike doesn't handle erg mode - if(VFSPINBIKE) { - forceResistance(((double)resistanceFromPowerRequest(power)) / 10.0); - return; - } } writeCharacteristic((uint8_t*)b.data(), b.length(), "injectWrite ", false, true);