Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Healthkit without apple watch #1947

Open
wants to merge 42 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
a746373
Update WorkoutTracking.swift
cagnulein Jan 4, 2024
ddafafa
building
cagnulein Jan 4, 2024
6e28f8a
Update WorkoutTracking.swift
cagnulein Jan 4, 2024
857839b
Update lockscreen.mm
cagnulein Jan 4, 2024
553e83a
doing
cagnulein Jan 4, 2024
d28acf3
Update lockscreen.mm
cagnulein Jan 4, 2024
fb3777b
Update WorkoutTracking.swift
cagnulein Jan 4, 2024
7d30088
Update homeform.cpp
cagnulein Jan 4, 2024
a95ab37
Update WorkoutTracking.swift
cagnulein Jan 4, 2024
6ea8c00
Merge branch 'master' into healthkit-without-apple-watch
cagnulein Jan 5, 2024
f378bc3
Update WorkoutTracking.swift
cagnulein Jan 5, 2024
821cddb
Merge branch 'master' into healthkit-without-apple-watch
cagnulein Jan 10, 2024
37f45b8
seems working
cagnulein Jan 10, 2024
0ad2f62
Update project.pbxproj
cagnulein Jan 10, 2024
942d213
merge
cagnulein Jan 19, 2024
f1c2414
Update project.pbxproj
cagnulein Jan 19, 2024
c6c8308
Merge branch 'master' into healthkit-without-apple-watch
cagnulein Jan 22, 2024
a84bfac
fixing speed
cagnulein Jan 22, 2024
45ca7b3
adding metrics also when the virtualbike is not the zwift interface
cagnulein Jan 22, 2024
6959993
adding device type
cagnulein Jan 22, 2024
1173f8f
Merge branch 'master' into healthkit-without-apple-watch
cagnulein Mar 12, 2024
d765f13
Merge branch 'master' into healthkit-without-apple-watch
cagnulein Aug 26, 2024
39599dc
Update project.pbxproj
cagnulein Aug 26, 2024
a5ef8df
fix build issue, forcing bike
cagnulein Aug 26, 2024
5d38be8
Merge branch 'master' into healthkit-without-apple-watch
cagnulein Sep 19, 2024
26c2619
adding kcal
cagnulein Sep 19, 2024
7e9024a
fix build
cagnulein Sep 20, 2024
fd200f4
Update project.pbxproj
cagnulein Sep 20, 2024
a7777f4
fix build
cagnulein Sep 20, 2024
329cf8b
Merge branch 'master' into healthkit-without-apple-watch
cagnulein Sep 23, 2024
0a71786
fake bike to test
cagnulein Sep 23, 2024
ef9ce3c
Merge branch 'master' into healthkit-without-apple-watch
cagnulein Sep 25, 2024
9962776
fixing crash and metrics
cagnulein Sep 25, 2024
90c8c16
Update WorkoutTracking.swift
cagnulein Sep 25, 2024
9da3d28
Update project.pbxproj
cagnulein Sep 25, 2024
c69714b
Merge branch 'master' into healthkit-without-apple-watch
cagnulein Oct 4, 2024
9685a00
Merge branch 'master' into healthkit-without-apple-watch
cagnulein Oct 30, 2024
7686ca4
adding logs
cagnulein Oct 30, 2024
69d8bab
Merge branch 'master' into healthkit-without-apple-watch
cagnulein Oct 31, 2024
6149578
improving logs
cagnulein Oct 31, 2024
df3620f
Update project.pbxproj
cagnulein Oct 31, 2024
1385156
Merge branch 'master' into healthkit-without-apple-watch
cagnulein Oct 31, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4068,7 +4068,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = "../src/ios/qdomyos-zwift.entitlements";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 922;
CURRENT_PROJECT_VERSION = 923;
DEVELOPMENT_TEAM = 6335M7T29D;
ENABLE_BITCODE = NO;
GCC_PREPROCESSOR_DEFINITIONS = "ADB_HOST=1";
Expand Down Expand Up @@ -4259,7 +4259,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = "../src/ios/qdomyos-zwift.entitlements";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 922;
CURRENT_PROJECT_VERSION = 923;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = 6335M7T29D;
ENABLE_BITCODE = NO;
Expand Down Expand Up @@ -4486,7 +4486,7 @@
CODE_SIGN_ENTITLEMENTS = "watchkit Extension/WatchKit Extension.entitlements";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 922;
CURRENT_PROJECT_VERSION = 923;
DEVELOPMENT_TEAM = 6335M7T29D;
ENABLE_BITCODE = YES;
ENABLE_STRICT_OBJC_MSGSEND = YES;
Expand Down Expand Up @@ -4582,7 +4582,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_ENTITLEMENTS = "watchkit Extension/WatchKit Extension.entitlements";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 922;
CURRENT_PROJECT_VERSION = 923;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = 6335M7T29D;
ENABLE_BITCODE = YES;
Expand Down Expand Up @@ -4674,7 +4674,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_ENTITLEMENTS = "watchkit Extension/WatchKit Extension.entitlements";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 922;
CURRENT_PROJECT_VERSION = 923;
DEVELOPMENT_ASSET_PATHS = "\"watchkit Extension/Preview Content\"";
ENABLE_BITCODE = YES;
ENABLE_PREVIEWS = YES;
Expand Down Expand Up @@ -4788,7 +4788,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_ENTITLEMENTS = "watchkit Extension/WatchKit Extension.entitlements";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 922;
CURRENT_PROJECT_VERSION = 923;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_ASSET_PATHS = "\"watchkit Extension/Preview Content\"";
ENABLE_BITCODE = YES;
Expand Down
1 change: 1 addition & 0 deletions src/devices/apexbike/apexbike.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ void apexbike::characteristicChanged(const QLowEnergyCharacteristic &characteris
settings.value(QZSettings::ios_peloton_workaround, QZSettings::default_ios_peloton_workaround).toBool();
if (ios_peloton_workaround && cadence && h && firstStateChanged) {
h->virtualbike_setCadence(currentCrankRevolutions(), lastCrankEventTime());
h->workoutTrackingUpdate(Speed.value(), Cadence.value(), (uint16_t)m_watt.value(), calories().value());
h->virtualbike_setHeartRate((uint8_t)metrics_override_heartrate());
}
#endif
Expand Down
3 changes: 2 additions & 1 deletion src/devices/bkoolbike/bkoolbike.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,8 @@ void bkoolbike::characteristicChanged(const QLowEnergyCharacteristic &characteri
bool ios_peloton_workaround =
settings.value(QZSettings::ios_peloton_workaround, QZSettings::default_ios_peloton_workaround).toBool();
if (ios_peloton_workaround && cadence && h && firstStateChanged) {
h->virtualbike_setCadence(currentCrankRevolutions(), lastCrankEventTime());
h->virtualbike_setCadence(currentCrankRevolutions(), lastCrankEventTime());
h->workoutTrackingUpdate(Speed.value(), Cadence.value(), (uint16_t)m_watt.value(), calories().value());
h->virtualbike_setHeartRate((uint8_t)currentHeart().value());
}
#endif
Expand Down
12 changes: 12 additions & 0 deletions src/devices/bluetooth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ bluetooth::bluetooth(bool logs, const QString &deviceName, bool noWriteResistanc

QString nordictrack_2950_ip =
settings.value(QZSettings::nordictrack_2950_ip, QZSettings::default_nordictrack_2950_ip).toString();
bool fake_bike =
settings.value(QZSettings::applewatch_fakedevice, QZSettings::default_applewatch_fakedevice).toBool();

if (settings.value(QZSettings::peloton_bike_ocr, QZSettings::default_peloton_bike_ocr).toBool() && !pelotonBike) {
pelotonBike = new pelotonbike(noWriteResistance, noHeartService);
Expand All @@ -47,6 +49,16 @@ bluetooth::bluetooth(bool logs, const QString &deviceName, bool noWriteResistanc
}
// this signal is not associated to anything in this moment, since the homeform is not loaded yet
this->signalBluetoothDeviceConnected(pelotonBike);
} else if (fake_bike) {
fakeBike = new fakebike(noWriteResistance, noHeartService, false);
emit deviceConnected(QBluetoothDeviceInfo());
connect(fakeBike, &bluetoothdevice::connectedAndDiscovered, this, &bluetooth::connectedAndDiscovered);
connect(fakeBike, &fakebike::debug, this, &bluetooth::debug);
if (this->discoveryAgent && !this->discoveryAgent->isActive()) {
emit searchingStop();
}
// this signal is not associated to anything in this moment, since the homeform is not loaded yet
this->signalBluetoothDeviceConnected(fakeBike);
}

#ifdef TEST
Expand Down
3 changes: 2 additions & 1 deletion src/devices/chronobike/chronobike.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,8 @@ void chronobike::characteristicChanged(const QLowEnergyCharacteristic &character
bool ios_peloton_workaround =
settings.value(QZSettings::ios_peloton_workaround, QZSettings::default_ios_peloton_workaround).toBool();
if (ios_peloton_workaround && cadence && h && firstStateChanged) {
h->virtualbike_setCadence(currentCrankRevolutions(), lastCrankEventTime());
h->virtualbike_setCadence(currentCrankRevolutions(), lastCrankEventTime());
h->workoutTrackingUpdate(Speed.value(), Cadence.value(), (uint16_t)m_watt.value(), calories().value());
h->virtualbike_setHeartRate((uint8_t)metrics_override_heartrate());
}
#endif
Expand Down
3 changes: 2 additions & 1 deletion src/devices/computrainerbike/computrainerbike.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,8 @@ void computrainerbike::update() {
bool ios_peloton_workaround =
settings.value(QZSettings::ios_peloton_workaround, QZSettings::default_ios_peloton_workaround).toBool();
if (ios_peloton_workaround && cadence && h && firstStateChanged) {
h->virtualbike_setCadence(currentCrankRevolutions(), lastCrankEventTime());
h->virtualbike_setCadence(currentCrankRevolutions(), lastCrankEventTime());
h->workoutTrackingUpdate(Speed.value(), Cadence.value(), (uint16_t)m_watt.value(), calories().value());
h->virtualbike_setHeartRate((uint8_t)metrics_override_heartrate());
}
#endif
Expand Down
3 changes: 2 additions & 1 deletion src/devices/concept2skierg/concept2skierg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,8 @@ void concept2skierg::characteristicChanged(const QLowEnergyCharacteristic &chara
settings.value(QZSettings::ios_peloton_workaround, QZSettings::default_ios_peloton_workaround).toBool();
if (ios_peloton_workaround && cadence && h && firstStateChanged) {

h->virtualbike_setCadence(currentCrankRevolutions(), lastCrankEventTime());
h->virtualbike_setCadence(currentCrankRevolutions(), lastCrankEventTime());
h->workoutTrackingUpdate(Speed.value(), Cadence.value(), (uint16_t)m_watt.value(), calories().value());
h->virtualbike_setHeartRate((uint8_t)metrics_override_heartrate());
}
#endif
Expand Down
3 changes: 2 additions & 1 deletion src/devices/csaferower/csaferower.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,8 @@ void csaferower::update() {
bool ios_peloton_workaround =
settings.value(QZSettings::ios_peloton_workaround, QZSettings::default_ios_peloton_workaround).toBool();
if (ios_peloton_workaround && cadence && h && firstStateChanged) {
h->virtualbike_setCadence(currentCrankRevolutions(), lastCrankEventTime());
h->virtualbike_setCadence(currentCrankRevolutions(), lastCrankEventTime());
h->workoutTrackingUpdate(Speed.value(), Cadence.value(), (uint16_t)m_watt.value(), calories().value());
h->virtualbike_setHeartRate((uint8_t)metrics_override_heartrate());
}
#endif
Expand Down
3 changes: 2 additions & 1 deletion src/devices/cscbike/cscbike.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,8 @@ void cscbike::characteristicChanged(const QLowEnergyCharacteristic &characterist
bool ios_peloton_workaround =
settings.value(QZSettings::ios_peloton_workaround, QZSettings::default_ios_peloton_workaround).toBool();
if (ios_peloton_workaround && cadence && h && firstStateChanged) {
h->virtualbike_setCadence(currentCrankRevolutions(), lastCrankEventTime());
h->virtualbike_setCadence(currentCrankRevolutions(), lastCrankEventTime());
h->workoutTrackingUpdate(Speed.value(), Cadence.value(), (uint16_t)m_watt.value(), calories().value());
h->virtualbike_setHeartRate((uint8_t)metrics_override_heartrate());
}
#endif
Expand Down
3 changes: 2 additions & 1 deletion src/devices/domyosbike/domyosbike.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,8 @@ void domyosbike::characteristicChanged(const QLowEnergyCharacteristic &character
bool ios_peloton_workaround =
settings.value(QZSettings::ios_peloton_workaround, QZSettings::default_ios_peloton_workaround).toBool();
if (ios_peloton_workaround && cadence && h && firstStateChanged) {
h->virtualbike_setCadence(currentCrankRevolutions(), lastCrankEventTime());
h->virtualbike_setCadence(currentCrankRevolutions(), lastCrankEventTime());
h->workoutTrackingUpdate(Speed.value(), Cadence.value(), (uint16_t)m_watt.value(), calories().value());
h->virtualbike_setHeartRate((uint8_t)metrics_override_heartrate());
}
#endif
Expand Down
3 changes: 2 additions & 1 deletion src/devices/domyosrower/domyosrower.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,8 @@ void domyosrower::characteristicChanged(const QLowEnergyCharacteristic &characte
settings.value(QZSettings::ios_peloton_workaround, QZSettings::default_ios_peloton_workaround).toBool();
if (ios_peloton_workaround && cadence && h && firstVirtual) {

h->virtualbike_setCadence(currentCrankRevolutions(), lastCrankEventTime());
h->virtualbike_setCadence(currentCrankRevolutions(), lastCrankEventTime());
h->workoutTrackingUpdate(Speed.value(), Cadence.value(), (uint16_t)m_watt.value(), calories().value());
h->virtualbike_setHeartRate((uint8_t)metrics_override_heartrate());
}
#endif
Expand Down
3 changes: 2 additions & 1 deletion src/devices/echelonconnectsport/echelonconnectsport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,8 @@ void echelonconnectsport::characteristicChanged(const QLowEnergyCharacteristic &
bool ios_peloton_workaround =
settings.value(QZSettings::ios_peloton_workaround, QZSettings::default_ios_peloton_workaround).toBool();
if (ios_peloton_workaround && cadence && h && firstStateChanged) {
h->virtualbike_setCadence(currentCrankRevolutions(), lastCrankEventTime());
h->virtualbike_setCadence(currentCrankRevolutions(), lastCrankEventTime());
h->workoutTrackingUpdate(Speed.value(), Cadence.value(), (uint16_t)m_watt.value(), calories().value());
h->virtualbike_setHeartRate((uint8_t)metrics_override_heartrate());
}
#endif
Expand Down
3 changes: 2 additions & 1 deletion src/devices/echelonrower/echelonrower.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,8 @@ void echelonrower::characteristicChanged(const QLowEnergyCharacteristic &charact
bool virtual_device_rower =
settings.value(QZSettings::virtual_device_rower, QZSettings::default_virtual_device_rower).toBool();
if (ios_peloton_workaround && cadence && !virtual_device_rower && h && firstStateChanged) {
h->virtualbike_setCadence(currentCrankRevolutions(), lastCrankEventTime());
h->virtualbike_setCadence(currentCrankRevolutions(), lastCrankEventTime());
h->workoutTrackingUpdate(Speed.value(), Cadence.value(), (uint16_t)m_watt.value(), calories().value());
h->virtualbike_setHeartRate((uint8_t)metrics_override_heartrate());
}
#endif
Expand Down
11 changes: 10 additions & 1 deletion src/devices/fakebike/fakebike.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@ void fakebike::update() {
speedLimit());
}

double weight = settings.value(QZSettings::weight, QZSettings::default_weight).toFloat();
if (watts())
KCal +=
((((0.048 * ((double)watts()) + 1.19) * weight * 3.5) / 200.0) /
(60000.0 / ((double)lastRefreshCharacteristicChanged.msecsTo(
QDateTime::currentDateTime())))); //(( (0.048* Output in watts +1.19) * body weight in
// kg * 3.5) / 200 ) / 60

if (Cadence.value() > 0) {
CrankRevs++;
LastCrankEventTime += (uint16_t)(1024.0 / (((double)(Cadence.value())) / 60.0));
Expand Down Expand Up @@ -132,7 +140,8 @@ void fakebike::update() {
bool ios_peloton_workaround =
settings.value(QZSettings::ios_peloton_workaround, QZSettings::default_ios_peloton_workaround).toBool();
if (ios_peloton_workaround && cadence && h && firstStateChanged) {
h->virtualbike_setCadence(currentCrankRevolutions(), lastCrankEventTime());
h->virtualbike_setCadence(currentCrankRevolutions(), lastCrankEventTime());
h->workoutTrackingUpdate(Speed.value(), Cadence.value(), (uint16_t)m_watt.value(), calories().value());
h->virtualbike_setHeartRate((uint8_t)metrics_override_heartrate());
}
#endif
Expand Down
3 changes: 2 additions & 1 deletion src/devices/fakeelliptical/fakeelliptical.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ void fakeelliptical::update() {
bool ios_peloton_workaround =
settings.value(QZSettings::ios_peloton_workaround, QZSettings::default_ios_peloton_workaround).toBool();
if (ios_peloton_workaround && cadence && h && firstStateChanged) {
h->virtualbike_setCadence(currentCrankRevolutions(), lastCrankEventTime());
h->virtualbike_setCadence(currentCrankRevolutions(), lastCrankEventTime());
h->workoutTrackingUpdate(Speed.value(), Cadence.value(), (uint16_t)m_watt.value(), calories().value());
h->virtualbike_setHeartRate((uint8_t)metrics_override_heartrate());
}
#endif
Expand Down
3 changes: 2 additions & 1 deletion src/devices/fakerower/fakerower.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ void fakerower::update() {
bool ios_peloton_workaround =
settings.value(QZSettings::ios_peloton_workaround, QZSettings::default_ios_peloton_workaround).toBool();
if (ios_peloton_workaround && cadence && h && firstStateChanged) {
h->virtualbike_setCadence(currentCrankRevolutions(), lastCrankEventTime());
h->virtualbike_setCadence(currentCrankRevolutions(), lastCrankEventTime());
h->workoutTrackingUpdate(Speed.value(), Cadence.value(), (uint16_t)m_watt.value(), calories().value());
h->virtualbike_setHeartRate((uint8_t)metrics_override_heartrate());
}
#endif
Expand Down
3 changes: 2 additions & 1 deletion src/devices/faketreadmill/faketreadmill.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ void faketreadmill::update() {
bool ios_peloton_workaround =
settings.value(QZSettings::ios_peloton_workaround, QZSettings::default_ios_peloton_workaround).toBool();
if (ios_peloton_workaround && cadence && h && firstStateChanged) {
h->virtualbike_setCadence(currentCrankRevolutions(), lastCrankEventTime());
h->virtualbike_setCadence(currentCrankRevolutions(), lastCrankEventTime());
h->workoutTrackingUpdate(Speed.value(), Cadence.value(), (uint16_t)m_watt.value(), calories().value());
h->virtualbike_setHeartRate((uint8_t)metrics_override_heartrate());
}
#endif
Expand Down
3 changes: 2 additions & 1 deletion src/devices/fitplusbike/fitplusbike.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,8 @@ void fitplusbike::characteristicChanged(const QLowEnergyCharacteristic &characte
bool ios_peloton_workaround =
settings.value(QZSettings::ios_peloton_workaround, QZSettings::default_ios_peloton_workaround).toBool();
if (ios_peloton_workaround && cadence && h && firstStateChanged) {
h->virtualbike_setCadence(currentCrankRevolutions(), lastCrankEventTime());
h->virtualbike_setCadence(currentCrankRevolutions(), lastCrankEventTime());
h->workoutTrackingUpdate(Speed.value(), Cadence.value(), (uint16_t)m_watt.value(), calories().value());
h->virtualbike_setHeartRate((uint8_t)metrics_override_heartrate());
}
#endif
Expand Down
3 changes: 2 additions & 1 deletion src/devices/flywheelbike/flywheelbike.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,8 @@ void flywheelbike::updateStats() {
bool ios_peloton_workaround =
settings.value(QZSettings::ios_peloton_workaround, QZSettings::default_ios_peloton_workaround).toBool();
if (ios_peloton_workaround && cadence && h && firstStateChanged) {
h->virtualbike_setCadence(currentCrankRevolutions(), lastCrankEventTime());
h->virtualbike_setCadence(currentCrankRevolutions(), lastCrankEventTime());
h->workoutTrackingUpdate(Speed.value(), Cadence.value(), (uint16_t)m_watt.value(), calories().value());
h->virtualbike_setHeartRate((uint8_t)metrics_override_heartrate());
}
#endif
Expand Down
3 changes: 2 additions & 1 deletion src/devices/ftmsbike/ftmsbike.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -877,7 +877,8 @@ void ftmsbike::characteristicChanged(const QLowEnergyCharacteristic &characteris
bool ios_peloton_workaround =
settings.value(QZSettings::ios_peloton_workaround, QZSettings::default_ios_peloton_workaround).toBool();
if (ios_peloton_workaround && cadence && h && firstStateChanged) {
h->virtualbike_setCadence(currentCrankRevolutions(), lastCrankEventTime());
h->virtualbike_setCadence(currentCrankRevolutions(), lastCrankEventTime());
h->workoutTrackingUpdate(Speed.value(), Cadence.value(), (uint16_t)m_watt.value(), calories().value());
h->virtualbike_setHeartRate((uint8_t)metrics_override_heartrate());
}
#endif
Expand Down
3 changes: 2 additions & 1 deletion src/devices/ftmsrower/ftmsrower.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,8 @@ void ftmsrower::characteristicChanged(const QLowEnergyCharacteristic &characteri
settings.value(QZSettings::ios_peloton_workaround, QZSettings::default_ios_peloton_workaround).toBool();
if (ios_peloton_workaround && cadence && h && firstStateChanged) {

h->virtualbike_setCadence(currentCrankRevolutions(), lastCrankEventTime());
h->virtualbike_setCadence(currentCrankRevolutions(), lastCrankEventTime());
h->workoutTrackingUpdate(Speed.value(), Cadence.value(), (uint16_t)m_watt.value(), calories().value());
h->virtualbike_setHeartRate((uint8_t)metrics_override_heartrate());
}
#endif
Expand Down
3 changes: 2 additions & 1 deletion src/devices/horizongr7bike/horizongr7bike.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,8 @@ void horizongr7bike::characteristicChanged(const QLowEnergyCharacteristic &chara
bool ios_peloton_workaround =
settings.value(QZSettings::ios_peloton_workaround, QZSettings::default_ios_peloton_workaround).toBool();
if (ios_peloton_workaround && cadence && h && firstStateChanged) {
h->virtualbike_setCadence(currentCrankRevolutions(), lastCrankEventTime());
h->virtualbike_setCadence(currentCrankRevolutions(), lastCrankEventTime());
h->workoutTrackingUpdate(Speed.value(), Cadence.value(), (uint16_t)m_watt.value(), calories().value());
h->virtualbike_setHeartRate((uint8_t)metrics_override_heartrate());
}
#endif
Expand Down
3 changes: 2 additions & 1 deletion src/devices/iconceptbike/iconceptbike.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,8 @@ void iconceptbike::readSocket() {
bool ios_peloton_workaround =
settings.value(QZSettings::ios_peloton_workaround, QZSettings::default_ios_peloton_workaround).toBool();
if (ios_peloton_workaround && cadence && h && firstStateChanged) {
h->virtualbike_setCadence(currentCrankRevolutions(), lastCrankEventTime());
h->virtualbike_setCadence(currentCrankRevolutions(), lastCrankEventTime());
h->workoutTrackingUpdate(Speed.value(), Cadence.value(), (uint16_t)m_watt.value(), calories().value());
h->virtualbike_setHeartRate((uint8_t)metrics_override_heartrate());
}
#endif
Expand Down
3 changes: 2 additions & 1 deletion src/devices/inspirebike/inspirebike.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,8 @@ void inspirebike::characteristicChanged(const QLowEnergyCharacteristic &characte
bool cadence = settings.value(QZSettings::bike_cadence_sensor, QZSettings::default_bike_cadence_sensor).toBool();
bool ios_peloton_workaround = settings.value(QZSettings::ios_peloton_workaround, QZSettings::default_ios_peloton_workaround).toBool();
if (ios_peloton_workaround && cadence && h && firstStateChanged) {
h->virtualbike_setCadence(currentCrankRevolutions(), lastCrankEventTime());
h->virtualbike_setCadence(currentCrankRevolutions(), lastCrankEventTime());
h->workoutTrackingUpdate(Speed.value(), Cadence.value(), (uint16_t)m_watt.value(), calories().value());
h->virtualbike_setHeartRate((uint8_t)metrics_override_heartrate());
}
#endif
Expand Down
3 changes: 2 additions & 1 deletion src/devices/keepbike/keepbike.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,8 @@ void keepbike::characteristicChanged(const QLowEnergyCharacteristic &characteris
bool ios_peloton_workaround =
settings.value(QZSettings::ios_peloton_workaround, QZSettings::default_ios_peloton_workaround).toBool();
if (ios_peloton_workaround && cadence && h && firstStateChanged) {
h->virtualbike_setCadence(currentCrankRevolutions(), lastCrankEventTime());
h->virtualbike_setCadence(currentCrankRevolutions(), lastCrankEventTime());
h->workoutTrackingUpdate(Speed.value(), Cadence.value(), (uint16_t)m_watt.value(), calories().value());
h->virtualbike_setHeartRate((uint8_t)metrics_override_heartrate());
}
#endif
Expand Down
Loading
Loading