Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
cagnulein committed Oct 10, 2024
2 parents 9b38e93 + e87687f commit 0bc0885
Show file tree
Hide file tree
Showing 8 changed files with 64 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,8 @@
876F9B61275385D8006AE6FA /* moc_fitmetria_fanfit.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 876F9B60275385D8006AE6FA /* moc_fitmetria_fanfit.cpp */; };
8772A0E625E43ADB0080718C /* trxappgateusbbike.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 8772A0E525E43ADA0080718C /* trxappgateusbbike.cpp */; };
8772A0E825E43AE70080718C /* moc_trxappgateusbbike.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 8772A0E725E43AE70080718C /* moc_trxappgateusbbike.cpp */; };
8772B7F42CB55E80004AB8E9 /* moc_deerruntreadmill.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 8772B7F32CB55E80004AB8E9 /* moc_deerruntreadmill.cpp */; };
8772B7F72CB55E98004AB8E9 /* deerruntreadmill.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 8772B7F62CB55E98004AB8E9 /* deerruntreadmill.cpp */; };
8775008329E876F8008E48B7 /* iconceptelliptical.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 8775008129E876F7008E48B7 /* iconceptelliptical.cpp */; };
8775008529E87713008E48B7 /* moc_iconceptelliptical.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 8775008429E87712008E48B7 /* moc_iconceptelliptical.cpp */; };
877758B32C98627300BB1697 /* moc_sportstechelliptical.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 877758B22C98627300BB1697 /* moc_sportstechelliptical.cpp */; };
Expand Down Expand Up @@ -1234,6 +1236,9 @@
8772A0E425E43AD90080718C /* trxappgateusbbike.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = trxappgateusbbike.h; path = ../src/devices/trxappgateusbbike/trxappgateusbbike.h; sourceTree = "<group>"; };
8772A0E525E43ADA0080718C /* trxappgateusbbike.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = trxappgateusbbike.cpp; path = ../src/devices/trxappgateusbbike/trxappgateusbbike.cpp; sourceTree = "<group>"; };
8772A0E725E43AE70080718C /* moc_trxappgateusbbike.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = moc_trxappgateusbbike.cpp; sourceTree = "<group>"; };
8772B7F32CB55E80004AB8E9 /* moc_deerruntreadmill.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = moc_deerruntreadmill.cpp; sourceTree = "<group>"; };
8772B7F62CB55E98004AB8E9 /* deerruntreadmill.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = deerruntreadmill.cpp; sourceTree = "<group>"; };
8772B7F92CB5603A004AB8E9 /* deerruntreadmill.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = deerruntreadmill.h; path = ../src/devices/deeruntreadmill/deerruntreadmill.h; sourceTree = SOURCE_ROOT; };
8775008129E876F7008E48B7 /* iconceptelliptical.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = iconceptelliptical.cpp; path = ../src/devices/iconceptelliptical/iconceptelliptical.cpp; sourceTree = "<group>"; };
8775008229E876F7008E48B7 /* iconceptelliptical.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = iconceptelliptical.h; path = ../src/devices/iconceptelliptical/iconceptelliptical.h; sourceTree = "<group>"; };
8775008429E87712008E48B7 /* moc_iconceptelliptical.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = moc_iconceptelliptical.cpp; sourceTree = "<group>"; };
Expand Down Expand Up @@ -2073,6 +2078,9 @@
2EB56BE3C2D93CDAB0C52E67 /* Sources */ = {
isa = PBXGroup;
children = (
8772B7F92CB5603A004AB8E9 /* deerruntreadmill.h */,
8772B7F62CB55E98004AB8E9 /* deerruntreadmill.cpp */,
8772B7F32CB55E80004AB8E9 /* moc_deerruntreadmill.cpp */,
877758B52C98629B00BB1697 /* sportstechelliptical.cpp */,
877758B42C98629B00BB1697 /* sportstechelliptical.h */,
877758B22C98627300BB1697 /* moc_sportstechelliptical.cpp */,
Expand Down Expand Up @@ -3300,6 +3308,7 @@
873824BC27E64707004F1B46 /* moc_resolver.cpp in Compile Sources */,
87FA11AD27C5ECE4008AC5D1 /* moc_ultrasportbike.cpp in Compile Sources */,
871235BF26B297670012D0F2 /* kingsmithr1protreadmill.cpp in Compile Sources */,
8772B7F72CB55E98004AB8E9 /* deerruntreadmill.cpp in Compile Sources */,
20A50533946A39CBD2C89104 /* bluetoothdevice.cpp in Compile Sources */,
87C5F0D126285E7E0067A1B5 /* moc_stagesbike.cpp in Compile Sources */,
873824E927E647A8004F1B46 /* mdns.cpp in Compile Sources */,
Expand Down Expand Up @@ -3410,6 +3419,7 @@
87310B22266FBB78008BA0D6 /* moc_homefitnessbuddy.cpp in Compile Sources */,
87958F1B27628D5400124B24 /* moc_elitesterzosmart.cpp in Compile Sources */,
8768C8D82BBC12890099DBE1 /* centraldir.c in Compile Sources */,
8772B7F42CB55E80004AB8E9 /* moc_deerruntreadmill.cpp in Compile Sources */,
87CC3BA425A0885F001EC5A8 /* elliptical.cpp in Compile Sources */,
4AD2C93A2B8FD5855E521630 /* fit_encode.cpp in Compile Sources */,
87EB918C27EE5FE7002535E1 /* moc_inappproduct.cpp in Compile Sources */,
Expand Down Expand Up @@ -4056,7 +4066,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = "../src/ios/qdomyos-zwift.entitlements";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 893;
CURRENT_PROJECT_VERSION = 898;
DEVELOPMENT_TEAM = 6335M7T29D;
ENABLE_BITCODE = NO;
GCC_PREPROCESSOR_DEFINITIONS = "ADB_HOST=1";
Expand Down Expand Up @@ -4247,7 +4257,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = "../src/ios/qdomyos-zwift.entitlements";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 893;
CURRENT_PROJECT_VERSION = 898;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = 6335M7T29D;
ENABLE_BITCODE = NO;
Expand Down Expand Up @@ -4474,7 +4484,7 @@
CODE_SIGN_ENTITLEMENTS = "watchkit Extension/WatchKit Extension.entitlements";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 893;
CURRENT_PROJECT_VERSION = 898;
DEVELOPMENT_TEAM = 6335M7T29D;
ENABLE_BITCODE = YES;
ENABLE_STRICT_OBJC_MSGSEND = YES;
Expand Down Expand Up @@ -4570,7 +4580,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_ENTITLEMENTS = "watchkit Extension/WatchKit Extension.entitlements";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 893;
CURRENT_PROJECT_VERSION = 898;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = 6335M7T29D;
ENABLE_BITCODE = YES;
Expand Down Expand Up @@ -4662,7 +4672,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_ENTITLEMENTS = "watchkit Extension/WatchKit Extension.entitlements";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 893;
CURRENT_PROJECT_VERSION = 898;
DEVELOPMENT_ASSET_PATHS = "\"watchkit Extension/Preview Content\"";
ENABLE_BITCODE = YES;
ENABLE_PREVIEWS = YES;
Expand Down Expand Up @@ -4776,7 +4786,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_ENTITLEMENTS = "watchkit Extension/WatchKit Extension.entitlements";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 893;
CURRENT_PROJECT_VERSION = 898;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_ASSET_PATHS = "\"watchkit Extension/Preview Content\"";
ENABLE_BITCODE = YES;
Expand Down
2 changes: 2 additions & 0 deletions src/devices/bluetooth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1516,6 +1516,7 @@ void bluetooth::deviceDiscovered(const QBluetoothDeviceInfo &device) {
(b.name().toUpper().startsWith("SPAX-BK-")) ||
(b.name().toUpper().startsWith("YSV1")) ||
(b.name().toUpper().startsWith("VOLT") && b.name().length() == 4) ||
(b.name().toUpper().startsWith("VICTORY")) ||
(b.name().toUpper().startsWith("CECOTEC")) || // Cecotec DrumFit Indoor 10000 MagnoMotor Connected #2420
(b.name().toUpper().startsWith("WATTBIKE")) ||
(b.name().toUpper().startsWith("ZYCLEZBIKE")) ||
Expand Down Expand Up @@ -2051,6 +2052,7 @@ void bluetooth::deviceDiscovered(const QBluetoothDeviceInfo &device) {
mcfBike->deviceDiscovered(b);
this->signalBluetoothDeviceConnected(mcfBike);
} else if ((b.name().startsWith(QStringLiteral("TRX ROUTE KEY")) ||
b.name().toUpper().startsWith(QStringLiteral("MASTERT40-")) ||
b.name().toUpper().startsWith(QStringLiteral("BH DUALKIT TREAD")) ||
b.name().toUpper().startsWith(QStringLiteral("BH-TR-"))) && !toorx && filter) {
this->setLastBluetoothDevice(b);
Expand Down
6 changes: 6 additions & 0 deletions src/devices/eslinkertreadmill/eslinkertreadmill.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,12 @@ void eslinkertreadmill::btinit(bool startTape) {
uint8_t initData5[] = {0xa9, 0x08, 0x01, 0xad, 0x0d};
writeCharacteristic(initData5, sizeof(initData5), QStringLiteral("init"), false, true);

QThread::msleep(400);

writeCharacteristic(initData5, sizeof(initData5), QStringLiteral("init"), false, true);

QThread::msleep(400);

uint8_t initData6[] = {0xa9, 0x08, 0x04, 0x0c, 0x06, 0x48, 0x12, 0xf5};
writeCharacteristic(initData6, sizeof(initData6), QStringLiteral("init"), false, true);

Expand Down
5 changes: 5 additions & 0 deletions src/devices/ftmsbike/ftmsbike.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1153,6 +1153,7 @@ resistance_t ftmsbike::pelotonToBikeResistance(int pelotonResistance) {
}

void ftmsbike::deviceDiscovered(const QBluetoothDeviceInfo &device) {
QSettings settings;
emit debug(QStringLiteral("Found new device: ") + device.name() + QStringLiteral(" (") +
device.address().toString() + ')');
{
Expand All @@ -1177,6 +1178,10 @@ void ftmsbike::deviceDiscovered(const QBluetoothDeviceInfo &device) {
qDebug() << QStringLiteral("_3G_Cardio_RB found");
_3G_Cardio_RB = true;
}

if(settings.value(QZSettings::force_resistance_instead_inclination, QZSettings::default_force_resistance_instead_inclination).toBool()) {
resistance_lvl_mode = true;
}

m_control = QLowEnergyController::createCentral(bluetoothDevice, this);
connect(m_control, &QLowEnergyController::serviceDiscovered, this, &ftmsbike::serviceDiscovered);
Expand Down
2 changes: 1 addition & 1 deletion src/devices/proformwifibike/proformwifibike.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -558,8 +558,8 @@ void proformwifibike::characteristicChanged(const QString &newValue) {
value = 5.0;
}
if (value != 0.0) {
forceResistance(currentInclination().value() + value); // to force an immediate change
setGears(gears() + value);
forceResistance(lastRawRequestedInclinationValue + gears()); // to force an immediate change
}
} else {
double value = 0;
Expand Down
4 changes: 3 additions & 1 deletion src/qzsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -766,8 +766,9 @@ const QString QZSettings::proform_carbon_tl_PFTL59720 = QStringLiteral("proform_
const QString QZSettings::proform_treadmill_sport_70 = QStringLiteral("proform_treadmill_sport_70");
const QString QZSettings::peloton_date_format = QStringLiteral("peloton_date_format");
const QString QZSettings::default_peloton_date_format = QStringLiteral("MM/dd/yy");
const QString QZSettings::force_resistance_instead_inclination = QStringLiteral("force_resistance_instead_inclination");

const uint32_t allSettingsCount = 648;
const uint32_t allSettingsCount = 649;

QVariant allSettings[allSettingsCount][2] = {
{QZSettings::cryptoKeySettingsProfiles, QZSettings::default_cryptoKeySettingsProfiles},
Expand Down Expand Up @@ -1422,6 +1423,7 @@ QVariant allSettings[allSettingsCount][2] = {
{QZSettings::proform_carbon_tl_PFTL59720, QZSettings::default_proform_carbon_tl_PFTL59720},
{QZSettings::proform_treadmill_sport_70, QZSettings::default_proform_treadmill_sport_70},
{QZSettings::peloton_date_format, QZSettings::default_peloton_date_format},
{QZSettings::force_resistance_instead_inclination, QZSettings::default_force_resistance_instead_inclination},
};

void QZSettings::qDebugAllSettings(bool showDefaults) {
Expand Down
3 changes: 3 additions & 0 deletions src/qzsettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -2144,6 +2144,9 @@ class QZSettings {
static const QString peloton_date_format;
static const QString default_peloton_date_format;

static const QString force_resistance_instead_inclination;
static constexpr bool default_force_resistance_instead_inclination = false;

/**
* @brief Write the QSettings values using the constants from this namespace.
* @param showDefaults Optionally indicates if the default should be shown with the key.
Expand Down
28 changes: 28 additions & 0 deletions src/settings.qml
Original file line number Diff line number Diff line change
Expand Up @@ -982,6 +982,7 @@ import QtQuick.Dialogs 1.0
// from version 2.16.71
property bool proform_treadmill_sport_70: false
property string peloton_date_format: "MM/dd/yy"
property bool force_resistance_instead_inclination: false
}

function paddingZeros(text, limit) {
Expand Down Expand Up @@ -8396,6 +8397,33 @@ import QtQuick.Dialogs 1.0
color: Material.color(Material.Lime)
}

SwitchDelegate {
text: qsTr("Use Resistance instead of Inclination")
spacing: 0
bottomPadding: 0
topPadding: 0
rightPadding: 0
leftPadding: 0
clip: false
checked: settings.force_resistance_instead_inclination
Layout.alignment: Qt.AlignLeft | Qt.AlignTop
Layout.fillWidth: true
onClicked: settings.force_resistance_instead_inclination = checked
}

Label {
text: qsTr("For the smart trainers, use resistance instead of inclination. This should help if you don't want to have the Wahoo Climb or similar to change inclination when you change gears. Default: disabled")
font.bold: true
font.italic: true
font.pixelSize: Qt.application.font.pixelSize - 2
textFormat: Text.PlainText
wrapMode: Text.WordWrap
verticalAlignment: Text.AlignVCenter
Layout.alignment: Qt.AlignLeft | Qt.AlignTop
Layout.fillWidth: true
color: Material.color(Material.Lime)
}

RowLayout {
spacing: 10
Label {
Expand Down

0 comments on commit 0bc0885

Please sign in to comment.