Skip to content

Commit

Permalink
Incorrect distance on QZ with Sole S77 treadmill #1781
Browse files Browse the repository at this point in the history
  • Loading branch information
cagnulein committed Nov 10, 2023
1 parent 7b8c8ea commit 2e0dde6
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/android/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<manifest package="org.cagnulen.qdomyoszwift" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:versionName="2.16.22" android:versionCode="656" android:installLocation="auto">
<manifest package="org.cagnulen.qdomyoszwift" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:versionName="2.16.23" android:versionCode="657" android:installLocation="auto">
<!-- The following comment will be replaced upon deployment with default permissions based on the dependencies of the application.
Remove the comment if you do not require these default permissions. -->
<!-- %%INSERT_PERMISSIONS -->
Expand Down
2 changes: 1 addition & 1 deletion src/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,7 @@ ApplicationWindow {
}

ItemDelegate {
text: "version 2.16.22"
text: "version 2.16.23"
width: parent.width
}

Expand Down
2 changes: 1 addition & 1 deletion src/qdomyos-zwift.pri
Original file line number Diff line number Diff line change
Expand Up @@ -815,4 +815,4 @@ INCLUDEPATH += purchasing/inapp

WINRT_MANIFEST = AppxManifest.xml

VERSION = 2.16.22
VERSION = 2.16.23
7 changes: 4 additions & 3 deletions src/solef80treadmill.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,7 @@ void solef80treadmill::characteristicChanged(const QLowEnergyCharacteristic &cha
emit debug(QStringLiteral("Current Average Speed: ") + QString::number(avgSpeed));
}

QDateTime now = QDateTime::currentDateTime();
if (Flags.totalDistance) {
// ignoring the distance, because it's a total life odometer
// Distance = ((double)((((uint32_t)((uint8_t)newValue.at(index + 2)) << 16) |
Expand All @@ -613,7 +614,7 @@ void solef80treadmill::characteristicChanged(const QLowEnergyCharacteristic &cha
// else
{
Distance += ((Speed.value() / 3600000.0) *
((double)lastRefreshCharacteristicChanged.msecsTo(QDateTime::currentDateTime())));
((double)lastRefreshCharacteristicChanged.msecsTo(now)));
}

emit debug(QStringLiteral("Current Distance: ") + QString::number(Distance.value()));
Expand Down Expand Up @@ -658,7 +659,7 @@ void solef80treadmill::characteristicChanged(const QLowEnergyCharacteristic &cha
200.0) /
(60000.0 /
((double)lastRefreshCharacteristicChanged.msecsTo(
QDateTime::currentDateTime())))); //(( (0.048* Output in watts +1.19) * body weight in
now)))); //(( (0.048* Output in watts +1.19) * body weight in
// kg * 3.5) / 200 ) / 60
}

Expand Down Expand Up @@ -698,7 +699,7 @@ void solef80treadmill::characteristicChanged(const QLowEnergyCharacteristic &cha
// todo
}

lastRefreshCharacteristicChanged = QDateTime::currentDateTime();
lastRefreshCharacteristicChanged = now;
}

if (heartRateBeltName.startsWith(QStringLiteral("Disabled"))) {
Expand Down

0 comments on commit 2e0dde6

Please sign in to comment.