Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/origin/master' into trixter-xdr…
Browse files Browse the repository at this point in the history
…eam-v1-bike
  • Loading branch information
drmason789 committed Jan 3, 2024
2 parents 6f0f30e + 3dfe880 commit f329bcc
Show file tree
Hide file tree
Showing 13 changed files with 425 additions and 193 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3754,7 +3754,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = "../src/ios/qdomyos-zwift.entitlements";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 694;
CURRENT_PROJECT_VERSION = 697;
DEVELOPMENT_TEAM = 6335M7T29D;
ENABLE_BITCODE = NO;
HEADER_SEARCH_PATHS = (
Expand Down Expand Up @@ -3924,7 +3924,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = "../src/ios/qdomyos-zwift.entitlements";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 694;
CURRENT_PROJECT_VERSION = 697;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = 6335M7T29D;
ENABLE_BITCODE = NO;
Expand Down Expand Up @@ -4130,7 +4130,7 @@
CODE_SIGN_ENTITLEMENTS = "watchkit Extension/WatchKit Extension.entitlements";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 694;
CURRENT_PROJECT_VERSION = 697;
DEVELOPMENT_TEAM = 6335M7T29D;
ENABLE_BITCODE = YES;
ENABLE_STRICT_OBJC_MSGSEND = YES;
Expand Down Expand Up @@ -4226,7 +4226,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_ENTITLEMENTS = "watchkit Extension/WatchKit Extension.entitlements";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 694;
CURRENT_PROJECT_VERSION = 697;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = 6335M7T29D;
ENABLE_BITCODE = YES;
Expand Down Expand Up @@ -4318,7 +4318,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_ENTITLEMENTS = "watchkit Extension/WatchKit Extension.entitlements";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 694;
CURRENT_PROJECT_VERSION = 697;
DEVELOPMENT_ASSET_PATHS = "\"watchkit Extension/Preview Content\"";
ENABLE_BITCODE = YES;
ENABLE_PREVIEWS = YES;
Expand Down Expand Up @@ -4432,7 +4432,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_ENTITLEMENTS = "watchkit Extension/WatchKit Extension.entitlements";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 694;
CURRENT_PROJECT_VERSION = 697;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_ASSET_PATHS = "\"watchkit Extension/Preview Content\"";
ENABLE_BITCODE = YES;
Expand Down
8 changes: 8 additions & 0 deletions src/bluetooth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,14 @@ void bluetooth::deviceDiscovered(const QBluetoothDeviceInfo &device) {
qDebug() << device.deviceUuid();
#endif

// not required for mobile I guess
#if !defined(Q_OS_ANDROID) && !defined(Q_OS_IOS)
if(!homeformLoaded) {
qDebug() << "homeform not yet loaded";
return;
}
#endif

if (onlyDiscover)
return;

Expand Down
1 change: 1 addition & 0 deletions src/bluetooth.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ class bluetooth : public QObject, public SignalHandler {
bluetoothdevice *heartRateDevice() { return heartRateBelt; }
QList<QBluetoothDeviceInfo> devices;
bool onlyDiscover = false;
volatile bool homeformLoaded = false;
protected:
/**
* @brief discoverNonBluetoothDevices Discover non-bluetooth devices and create an object for the first.
Expand Down
4 changes: 4 additions & 0 deletions src/homeform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,8 @@ homeform::homeform(QQmlApplicationEngine *engine, bluetooth *bl) {
QObject::connect(stack, SIGNAL(floatingOpen()), this, SLOT(floatingOpen()));
QObject::connect(stack, SIGNAL(openFloatingWindowBrowser()), this, SLOT(openFloatingWindowBrowser()));

qDebug() << "homeform constructor events linked";

#if !defined(Q_OS_ANDROID) && !defined(Q_OS_IOS)
QObject::connect(engine, &QQmlApplicationEngine::quit, &QGuiApplication::quit);
#endif
Expand Down Expand Up @@ -653,6 +655,8 @@ homeform::homeform(QQmlApplicationEngine *engine, bluetooth *bl) {
});
});
#endif

bluetoothManager->homeformLoaded = true;
}

void homeform::setActivityDescription(QString desc) { activityDescription = desc; }
Expand Down
2 changes: 1 addition & 1 deletion src/ios/lockscreen.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class lockscreen {
void virtualbike_setHeartRate(unsigned char heartRate);
void virtualbike_setCadence(unsigned short crankRevolutions, unsigned short lastCrankEventTime);

void virtualbike_zwift_ios(bool disable_hr);
void virtualbike_zwift_ios(bool disable_hr, bool garmin_bluetooth_compatibility);
double virtualbike_getCurrentSlope();
double virtualbike_getCurrentCRR();
double virtualbike_getCurrentCW();
Expand Down
4 changes: 2 additions & 2 deletions src/ios/lockscreen.mm
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@
[_virtualbike updateCadenceWithCrankRevolutions:crankRevolutions LastCrankEventTime:lastCrankEventTime];
}

void lockscreen::virtualbike_zwift_ios(bool disable_hr)
void lockscreen::virtualbike_zwift_ios(bool disable_hr, bool garmin_bluetooth_compatibility)
{
_virtualbike_zwift = [[virtualbike_zwift alloc] initWithDisable_hr: disable_hr];
_virtualbike_zwift = [[virtualbike_zwift alloc] initWithDisable_hr:disable_hr garmin_bluetooth_compatibility:garmin_bluetooth_compatibility];
}

void lockscreen::virtualrower_ios()
Expand Down
Loading

0 comments on commit f329bcc

Please sign in to comment.