mirror of
https://github.com/cagnulein/qdomyos-zwift.git
synced 2026-02-18 00:17:41 +01:00
Compare commits
20 Commits
opencv_and
...
2.14.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
867143e43e | ||
|
|
b85d7d72f5 | ||
|
|
32cb3b9e37 | ||
|
|
3ff8938b41 | ||
|
|
5156cb38f0 | ||
|
|
dd4a5dbc54 | ||
|
|
cf37b8705e | ||
|
|
bc8302c761 | ||
|
|
76ecf5c66e | ||
|
|
3693c2d1b2 | ||
|
|
3905bd8ba7 | ||
|
|
92cac7485e | ||
|
|
458c44758e | ||
|
|
be12859343 | ||
|
|
d201919b55 | ||
|
|
138a42c2e6 | ||
|
|
bbe69f3f60 | ||
|
|
b95b3a5018 | ||
|
|
fb0cbb74a5 | ||
|
|
deed6019ab |
@@ -3666,7 +3666,7 @@
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CODE_SIGN_ENTITLEMENTS = "../src/ios/qdomyos-zwift.entitlements";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
CURRENT_PROJECT_VERSION = 612;
|
||||
CURRENT_PROJECT_VERSION = 620;
|
||||
DEVELOPMENT_TEAM = 6335M7T29D;
|
||||
ENABLE_BITCODE = NO;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
@@ -3741,7 +3741,7 @@
|
||||
/Users/cagnulein/Qt/5.15.2/ios/plugins/playlistformats,
|
||||
/Users/cagnulein/Qt/5.15.2/ios/plugins/audio,
|
||||
);
|
||||
MARKETING_VERSION = 2.13;
|
||||
MARKETING_VERSION = 2.14;
|
||||
OTHER_CFLAGS = (
|
||||
"-pipe",
|
||||
"-g",
|
||||
@@ -3834,7 +3834,7 @@
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CODE_SIGN_ENTITLEMENTS = "../src/ios/qdomyos-zwift.entitlements";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
CURRENT_PROJECT_VERSION = 612;
|
||||
CURRENT_PROJECT_VERSION = 620;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
DEVELOPMENT_TEAM = 6335M7T29D;
|
||||
ENABLE_BITCODE = NO;
|
||||
@@ -3911,7 +3911,7 @@
|
||||
/Users/cagnulein/Qt/5.15.2/ios/plugins/playlistformats,
|
||||
/Users/cagnulein/Qt/5.15.2/ios/plugins/audio,
|
||||
);
|
||||
MARKETING_VERSION = 2.13;
|
||||
MARKETING_VERSION = 2.14;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
OTHER_CFLAGS = (
|
||||
"-pipe",
|
||||
@@ -4038,7 +4038,7 @@
|
||||
CODE_SIGN_ENTITLEMENTS = "watchkit Extension/WatchKit Extension.entitlements";
|
||||
CODE_SIGN_IDENTITY = "Apple Development";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 612;
|
||||
CURRENT_PROJECT_VERSION = 620;
|
||||
DEVELOPMENT_TEAM = 6335M7T29D;
|
||||
ENABLE_BITCODE = YES;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
@@ -4063,7 +4063,7 @@
|
||||
"@executable_path/../Frameworks",
|
||||
"@loader_path/../Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 2.13;
|
||||
MARKETING_VERSION = 2.14;
|
||||
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
|
||||
MTL_FAST_MATH = YES;
|
||||
OTHER_CODE_SIGN_FLAGS = "--generate-entitlement-der";
|
||||
@@ -4134,7 +4134,7 @@
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
CODE_SIGN_ENTITLEMENTS = "watchkit Extension/WatchKit Extension.entitlements";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 612;
|
||||
CURRENT_PROJECT_VERSION = 620;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
DEVELOPMENT_TEAM = 6335M7T29D;
|
||||
ENABLE_BITCODE = YES;
|
||||
@@ -4155,7 +4155,7 @@
|
||||
"@executable_path/../Frameworks",
|
||||
"@loader_path/../Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 2.13;
|
||||
MARKETING_VERSION = 2.14;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
MTL_FAST_MATH = YES;
|
||||
OTHER_CODE_SIGN_FLAGS = "--generate-entitlement-der";
|
||||
@@ -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 = 612;
|
||||
CURRENT_PROJECT_VERSION = 620;
|
||||
DEVELOPMENT_ASSET_PATHS = "\"watchkit Extension/Preview Content\"";
|
||||
ENABLE_BITCODE = YES;
|
||||
ENABLE_PREVIEWS = YES;
|
||||
@@ -4271,7 +4271,7 @@
|
||||
"@executable_path/Frameworks",
|
||||
"@executable_path/../../Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 2.13;
|
||||
MARKETING_VERSION = 2.14;
|
||||
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
|
||||
MTL_FAST_MATH = YES;
|
||||
OTHER_CODE_SIGN_FLAGS = "--generate-entitlement-der";
|
||||
@@ -4340,7 +4340,7 @@
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
CODE_SIGN_ENTITLEMENTS = "watchkit Extension/WatchKit Extension.entitlements";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 612;
|
||||
CURRENT_PROJECT_VERSION = 620;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
DEVELOPMENT_ASSET_PATHS = "\"watchkit Extension/Preview Content\"";
|
||||
ENABLE_BITCODE = YES;
|
||||
@@ -4381,7 +4381,7 @@
|
||||
"@executable_path/Frameworks",
|
||||
"@executable_path/../../Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 2.13;
|
||||
MARKETING_VERSION = 2.14;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
MTL_FAST_MATH = YES;
|
||||
OTHER_CODE_SIGN_FLAGS = "--generate-entitlement-der";
|
||||
|
||||
BIN
qt-patches/android/5.15.0/jar/QtAndroidBluetooth.jar
Normal file
BIN
qt-patches/android/5.15.0/jar/QtAndroidBluetooth.jar
Normal file
Binary file not shown.
@@ -93,7 +93,7 @@ Item {
|
||||
onLinkActivated: Qt.openUrlExternally(link)
|
||||
}
|
||||
|
||||
/*Button {
|
||||
Button {
|
||||
id: restoreButton
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
@@ -101,7 +101,8 @@ Item {
|
||||
text: "Restore Purchases"
|
||||
onClicked: {
|
||||
console.log("restoring...");
|
||||
toast.show("Restoring...");
|
||||
iapStore.restorePurchases();
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.13.98" android:versionCode="614" 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.14.1" android:versionCode="620" 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 -->
|
||||
|
||||
@@ -711,7 +711,8 @@ void bluetooth::deviceDiscovered(const QBluetoothDeviceInfo &device) {
|
||||
this->signalBluetoothDeviceConnected(nordictrackifitadbTreadmill);
|
||||
} else if (!tdf_10_ip.isEmpty() && !nordictrackifitadbBike) {
|
||||
this->stopDiscovery();
|
||||
nordictrackifitadbBike = new nordictrackifitadbbike(noWriteResistance, noHeartService);
|
||||
nordictrackifitadbBike = new nordictrackifitadbbike(noWriteResistance, noHeartService,
|
||||
bikeResistanceOffset, bikeResistanceGain);
|
||||
emit deviceConnected(b);
|
||||
connect(nordictrackifitadbBike, &bluetoothdevice::connectedAndDiscovered, this,
|
||||
&bluetooth::connectedAndDiscovered);
|
||||
@@ -1089,7 +1090,7 @@ void bluetooth::deviceDiscovered(const QBluetoothDeviceInfo &device) {
|
||||
if (this->discoveryAgent && !this->discoveryAgent->isActive())
|
||||
emit searchingStop();
|
||||
this->signalBluetoothDeviceConnected(trueTreadmill);
|
||||
} else if ((b.name().toUpper().startsWith(QStringLiteral("F80")) ||
|
||||
} else if (((b.name().toUpper().startsWith(QStringLiteral("F80")) && sole_inclination) ||
|
||||
b.name().toUpper().startsWith(QStringLiteral("F65")) ||
|
||||
b.name().toUpper().startsWith(QStringLiteral("TT8")) ||
|
||||
b.name().toUpper().startsWith(QStringLiteral("F63")) ||
|
||||
@@ -1170,6 +1171,7 @@ void bluetooth::deviceDiscovered(const QBluetoothDeviceInfo &device) {
|
||||
b.name().toUpper().startsWith(QStringLiteral("ASSAULTRUNNER")) || // FTMS
|
||||
(b.name().toUpper().startsWith(QStringLiteral("CTM")) && b.name().length() >= 15) || // FTMS
|
||||
(b.name().toUpper().startsWith(QStringLiteral("F85")) && !sole_inclination) || // FMTS
|
||||
(b.name().toUpper().startsWith(QStringLiteral("F80")) && !sole_inclination) || // FMTS
|
||||
b.name().toUpper().startsWith(QStringLiteral("ESANGLINKER"))) &&
|
||||
!horizonTreadmill && filter) {
|
||||
this->setLastBluetoothDevice(b);
|
||||
|
||||
@@ -361,7 +361,7 @@ void ftmsbike::characteristicChanged(const QLowEnergyCharacteristic &characteris
|
||||
#endif
|
||||
{
|
||||
if (Flags.heartRate && !disable_hr_frommachinery && newValue.length() > index) {
|
||||
Heart = ((double)((newValue.at(index))));
|
||||
Heart = ((double)(((uint8_t)newValue.at(index))));
|
||||
// index += 1; // NOTE: clang-analyzer-deadcode.DeadStores
|
||||
emit debug(QStringLiteral("Current Heart: ") + QString::number(Heart.value()));
|
||||
} else {
|
||||
@@ -551,7 +551,7 @@ void ftmsbike::characteristicChanged(const QLowEnergyCharacteristic &characteris
|
||||
#endif
|
||||
{
|
||||
if (Flags.heartRate && !disable_hr_frommachinery && newValue.length() > index) {
|
||||
Heart = ((double)((newValue.at(index))));
|
||||
Heart = ((double)(((uint8_t)newValue.at(index))));
|
||||
// index += 1; // NOTE: clang-analyzer-deadcode.DeadStores
|
||||
emit debug(QStringLiteral("Current Heart: ") + QString::number(Heart.value()));
|
||||
} else {
|
||||
|
||||
@@ -760,7 +760,7 @@ void homeform::peloton_start_workout() {
|
||||
if (!stravaPelotonActivityName.isEmpty() && !stravaPelotonInstructorName.isEmpty()) {
|
||||
QString path = getWritableAppDir() + "training/" + workoutNameBasedOnBluetoothDevice() + "/" +
|
||||
stravaPelotonInstructorName + "/";
|
||||
QDir().mkdir(path);
|
||||
QDir().mkpath(path);
|
||||
lastTrainProgramFileSaved =
|
||||
path + stravaPelotonActivityName.replace("/", "-") + " - " + stravaPelotonInstructorName + ".xml";
|
||||
trainProgram->save(lastTrainProgramFileSaved);
|
||||
@@ -3202,6 +3202,9 @@ void homeform::StopRequested() {
|
||||
|
||||
void homeform::Stop() {
|
||||
QSettings settings;
|
||||
|
||||
m_startRequested = false;
|
||||
|
||||
qDebug() << QStringLiteral("Stop pressed - paused") << paused << QStringLiteral("stopped") << stopped;
|
||||
|
||||
if (stopped) {
|
||||
@@ -3533,7 +3536,22 @@ void homeform::update() {
|
||||
wattKg->setSecondLine(
|
||||
QStringLiteral("AVG: ") + QString::number(bluetoothManager->device()->wattKg().average(), 'f', 1) +
|
||||
QStringLiteral("MAX: ") + QString::number(bluetoothManager->device()->wattKg().max(), 'f', 1));
|
||||
datetime->setValue(QTime::currentTime().toString(QStringLiteral("hh:mm:ss")));
|
||||
QLocale locale = QLocale::system();
|
||||
|
||||
// Format the time based on the locale
|
||||
QString timeFormat = locale.timeFormat(QLocale::ShortFormat);
|
||||
bool usesAMPMFormat = timeFormat.toUpper().contains("A");
|
||||
QDateTime currentTime = QDateTime::currentDateTime();
|
||||
|
||||
QString formattedTime;
|
||||
if (usesAMPMFormat) {
|
||||
// The locale uses 12-hour format with AM/PM
|
||||
formattedTime = currentTime.toString("h:mm:ss AP");
|
||||
} else {
|
||||
// The locale uses 24-hour format
|
||||
formattedTime = currentTime.toString("H:mm:ss");
|
||||
}
|
||||
datetime->setValue(formattedTime);
|
||||
if (power5s)
|
||||
watts = bluetoothManager->device()->wattsMetric().average5s();
|
||||
else
|
||||
@@ -5959,6 +5977,10 @@ void homeform::sendMail() {
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef SMTP_SERVER
|
||||
textMessage += QStringLiteral("\n\nSMTP server: ") + QString(STRINGIFY(SMTP_SERVER));
|
||||
#endif
|
||||
|
||||
text.setText(textMessage);
|
||||
message.addPart(&text);
|
||||
|
||||
|
||||
@@ -737,7 +737,7 @@ ApplicationWindow {
|
||||
}
|
||||
|
||||
ItemDelegate {
|
||||
text: "version 2.13.98"
|
||||
text: "version 2.14.1"
|
||||
width: parent.width
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,8 @@
|
||||
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
nordictrackifitadbbike::nordictrackifitadbbike(bool noWriteResistance, bool noHeartService) {
|
||||
nordictrackifitadbbike::nordictrackifitadbbike(bool noWriteResistance, bool noHeartService, uint8_t bikeResistanceOffset,
|
||||
double bikeResistanceGain) {
|
||||
QSettings settings;
|
||||
bool nordictrack_ifit_adb_remote = settings.value(QZSettings::nordictrack_ifit_adb_remote, QZSettings::default_nordictrack_ifit_adb_remote).toBool();
|
||||
m_watt.setType(metric::METRIC_WATT);
|
||||
@@ -36,15 +37,29 @@ nordictrackifitadbbike::nordictrackifitadbbike(bool noWriteResistance, bool noHe
|
||||
if (!firstStateChanged && !this->hasVirtualDevice()) {
|
||||
bool virtual_device_enabled =
|
||||
settings.value(QZSettings::virtual_device_enabled, QZSettings::default_virtual_device_enabled).toBool();
|
||||
if (virtual_device_enabled) {
|
||||
debug("creating virtual bike interface...");
|
||||
auto virtualBike = new virtualbike(this);
|
||||
connect(virtualBike, &virtualbike::changeInclination, this,
|
||||
&nordictrackifitadbbike::changeInclinationRequested);
|
||||
this->setVirtualDevice(virtualBike, VIRTUAL_DEVICE_MODE::PRIMARY);
|
||||
firstStateChanged = 1;
|
||||
#ifdef Q_OS_IOS
|
||||
#ifndef IO_UNDER_QT
|
||||
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) {
|
||||
qDebug() << "ios_peloton_workaround activated!";
|
||||
h = new lockscreen();
|
||||
h->virtualbike_ios();
|
||||
} else
|
||||
#endif
|
||||
#endif
|
||||
if (virtual_device_enabled) {
|
||||
qDebug() << QStringLiteral("creating virtual bike interface...");
|
||||
auto virtualBike =
|
||||
new virtualbike(this, noWriteResistance, noHeartService, bikeResistanceOffset, bikeResistanceGain);
|
||||
// connect(virtualBike,&virtualbike::debug ,this,&echelonconnectsport::debug);
|
||||
connect(virtualBike, &virtualbike::changeInclination, this, &nordictrackifitadbbike::changeInclination);
|
||||
this->setVirtualDevice(virtualBike, VIRTUAL_DEVICE_MODE::PRIMARY);
|
||||
}
|
||||
}
|
||||
firstStateChanged = 1;
|
||||
// ********************************************************************************************************
|
||||
|
||||
#ifdef Q_OS_ANDROID
|
||||
@@ -174,6 +189,11 @@ void nordictrackifitadbbike::processPendingDatagrams() {
|
||||
// KCal = (((uint16_t)((uint8_t)newValue.at(15)) << 8) + (uint16_t)((uint8_t) newValue.at(14)));
|
||||
Distance += ((Speed.value() / 3600000.0) *
|
||||
((double)lastRefreshCharacteristicChanged.msecsTo(QDateTime::currentDateTime())));
|
||||
|
||||
if (Cadence.value() > 0) {
|
||||
CrankRevs++;
|
||||
LastCrankEventTime += (uint16_t)(1024.0 / (((double)(Cadence.value())) / 60.0));
|
||||
}
|
||||
|
||||
lastRefreshCharacteristicChanged = QDateTime::currentDateTime();
|
||||
|
||||
@@ -188,6 +208,18 @@ void nordictrackifitadbbike::processPendingDatagrams() {
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef Q_OS_IOS
|
||||
#ifndef IO_UNDER_QT
|
||||
bool cadencep = 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 && cadencep && h && firstStateChanged) {
|
||||
h->virtualbike_setCadence(currentCrankRevolutions(), lastCrankEventTime());
|
||||
h->virtualbike_setHeartRate((uint8_t)metrics_override_heartrate());
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
emit debug(QStringLiteral("Current Watt: ") + QString::number(watts()));
|
||||
emit debug(QStringLiteral("Current Resistance: ") + QString::number(Resistance.value()));
|
||||
emit debug(QStringLiteral("Current Gear: ") + QString::number(gear));
|
||||
|
||||
@@ -28,7 +28,8 @@
|
||||
class nordictrackifitadbbike : public bike {
|
||||
Q_OBJECT
|
||||
public:
|
||||
nordictrackifitadbbike(bool noWriteResistance, bool noHeartService);
|
||||
nordictrackifitadbbike(bool noWriteResistance, bool noHeartService, uint8_t bikeResistanceOffset,
|
||||
double bikeResistanceGain);
|
||||
bool connected() override;
|
||||
resistance_t pelotonToBikeResistance(int pelotonResistance) override;
|
||||
bool inclinationAvailableByHardware() override;
|
||||
|
||||
@@ -812,4 +812,4 @@ INCLUDEPATH += purchasing/inapp
|
||||
|
||||
WINRT_MANIFEST = AppxManifest.xml
|
||||
|
||||
VERSION = 2.13.98
|
||||
VERSION = 2.14.1
|
||||
|
||||
@@ -664,8 +664,9 @@ const QString QZSettings::fakedevice_rower = QStringLiteral("fakedevice_rower");
|
||||
const QString QZSettings::zwift_ocr_climb_portal = QStringLiteral("zwift_ocr_climb_portal");
|
||||
const QString QZSettings::poll_device_time = QStringLiteral("poll_device_time");
|
||||
const QString QZSettings::proform_bike_PFEVEX71316_1 = QStringLiteral("proform_bike_PFEVEX71316_1");
|
||||
const QString QZSettings::schwinn_bike_resistance_v3 = QStringLiteral("schwinn_bike_resistance_v3");
|
||||
|
||||
const uint32_t allSettingsCount = 556;
|
||||
const uint32_t allSettingsCount = 557;
|
||||
|
||||
QVariant allSettings[allSettingsCount][2] = {
|
||||
{QZSettings::cryptoKeySettingsProfiles, QZSettings::default_cryptoKeySettingsProfiles},
|
||||
@@ -1228,6 +1229,7 @@ QVariant allSettings[allSettingsCount][2] = {
|
||||
{QZSettings::zwift_ocr_climb_portal, QZSettings::default_zwift_ocr_climb_portal},
|
||||
{QZSettings::poll_device_time, QZSettings::default_poll_device_time},
|
||||
{QZSettings::proform_bike_PFEVEX71316_1, QZSettings::default_proform_bike_PFEVEX71316_1},
|
||||
{QZSettings::schwinn_bike_resistance_v3, QZSettings::default_schwinn_bike_resistance_v3},
|
||||
};
|
||||
|
||||
void QZSettings::qDebugAllSettings(bool showDefaults) {
|
||||
|
||||
@@ -1863,6 +1863,9 @@ class QZSettings {
|
||||
static const QString proform_bike_PFEVEX71316_1;
|
||||
static constexpr bool default_proform_bike_PFEVEX71316_1 = false;
|
||||
|
||||
static const QString schwinn_bike_resistance_v3;
|
||||
static constexpr bool default_schwinn_bike_resistance_v3 = 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.
|
||||
|
||||
@@ -555,6 +555,8 @@ resistance_t schwinnic4bike::pelotonToBikeResistance(int pelotonResistance) {
|
||||
QSettings settings;
|
||||
bool schwinn_bike_resistance_v2 =
|
||||
settings.value(QZSettings::schwinn_bike_resistance_v2, QZSettings::default_schwinn_bike_resistance_v2).toBool();
|
||||
bool schwinn_bike_resistance_v3 =
|
||||
settings.value(QZSettings::schwinn_bike_resistance_v3, QZSettings::default_schwinn_bike_resistance_v3).toBool();
|
||||
if (!schwinn_bike_resistance_v2) {
|
||||
if (pelotonResistance > 54)
|
||||
return pelotonResistance;
|
||||
@@ -563,6 +565,12 @@ resistance_t schwinnic4bike::pelotonToBikeResistance(int pelotonResistance) {
|
||||
|
||||
// y = 0,04x2 - 1,32x + 11,8
|
||||
return ((0.04 * pow(pelotonResistance, 2)) - (1.32 * pelotonResistance) + 11.8);
|
||||
} else if (schwinn_bike_resistance_v3) {
|
||||
// y = 0,0007x3 - 0,0763x2 + 4,1619x - 75,788
|
||||
if (pelotonResistance < 30)
|
||||
return 0;
|
||||
|
||||
return qRound((0.0007 * pow(pelotonResistance, 3)) - (0.0763 * pow(pelotonResistance, 2)) + (4.1619 * pelotonResistance) - 75.788);
|
||||
} else {
|
||||
if (pelotonResistance > 20)
|
||||
return (((double)pelotonResistance - 20.0) * 1.25);
|
||||
|
||||
@@ -810,6 +810,7 @@ import QtQuick.Dialogs 1.0
|
||||
|
||||
// from version 2.13.99
|
||||
property bool proform_bike_PFEVEX71316_1: false
|
||||
property bool schwinn_bike_resistance_v3: false
|
||||
}
|
||||
|
||||
function paddingZeros(text, limit) {
|
||||
@@ -2214,7 +2215,7 @@ import QtQuick.Dialogs 1.0
|
||||
}
|
||||
SwitchDelegate {
|
||||
id: schwinnBikeResistanceV2Delegate
|
||||
text: qsTr("Resistance Alternative Calc.")
|
||||
text: qsTr("Res. Alternative Calc. v2")
|
||||
spacing: 0
|
||||
bottomPadding: 0
|
||||
topPadding: 0
|
||||
@@ -2226,6 +2227,19 @@ import QtQuick.Dialogs 1.0
|
||||
Layout.fillWidth: true
|
||||
onClicked: settings.schwinn_bike_resistance_v2 = checked
|
||||
}
|
||||
SwitchDelegate {
|
||||
text: qsTr("Res. Alternative Calc. v3")
|
||||
spacing: 0
|
||||
bottomPadding: 0
|
||||
topPadding: 0
|
||||
rightPadding: 0
|
||||
leftPadding: 0
|
||||
clip: false
|
||||
checked: settings.schwinn_bike_resistance_v3
|
||||
Layout.alignment: Qt.AlignLeft | Qt.AlignTop
|
||||
Layout.fillWidth: true
|
||||
onClicked: settings.schwinn_bike_resistance_v3 = checked
|
||||
}
|
||||
RowLayout {
|
||||
spacing: 10
|
||||
Label {
|
||||
|
||||
@@ -234,7 +234,10 @@ void wahookickrsnapbike::update() {
|
||||
uint8_t b[20];
|
||||
memcpy(b, a.constData(), a.length());
|
||||
writeCharacteristic(b, a.length(), "setResistance", false, true);
|
||||
} else if (virtualBike && virtualBike->ftmsDeviceConnected() && lastGearValue != gears()) {
|
||||
inclinationChanged(lastGrade, lastGrade);
|
||||
}
|
||||
lastGearValue = gears();
|
||||
requestResistance = -1;
|
||||
}
|
||||
if (requestStart != -1) {
|
||||
@@ -789,8 +792,9 @@ void wahookickrsnapbike::controllerStateChanged(QLowEnergyController::Controller
|
||||
|
||||
void wahookickrsnapbike::inclinationChanged(double grade, double percentage) {
|
||||
Q_UNUSED(percentage);
|
||||
lastGrade = grade;
|
||||
emit debug(QStringLiteral("writing inclination ") + QString::number(grade));
|
||||
QByteArray a = setSimGrade(grade);
|
||||
QByteArray a = setSimGrade(grade + gears());
|
||||
uint8_t b[20];
|
||||
memcpy(b, a.constData(), a.length());
|
||||
writeCharacteristic(b, a.length(), "setSimGrade", false, true);
|
||||
|
||||
@@ -83,6 +83,8 @@ class wahookickrsnapbike : public bike {
|
||||
|
||||
uint8_t sec1Update = 0;
|
||||
QByteArray lastPacket;
|
||||
double lastGearValue = -1;
|
||||
double lastGrade = 0;
|
||||
QDateTime lastRefreshCharacteristicChanged = QDateTime::currentDateTime();
|
||||
QDateTime lastGoodCadence = QDateTime::currentDateTime();
|
||||
uint8_t firstStateChanged = 0;
|
||||
|
||||
@@ -7,7 +7,6 @@ class SoleF80TreadmillTestData : public BluetoothDeviceTestData {
|
||||
|
||||
public:
|
||||
SoleF80TreadmillTestData() : BluetoothDeviceTestData("Sole F80") {
|
||||
this->addDeviceName("F80", comparison::StartsWithIgnoreCase);
|
||||
this->addDeviceName("F65", comparison::StartsWithIgnoreCase);
|
||||
this->addDeviceName("S77", comparison::StartsWithIgnoreCase);
|
||||
this->addDeviceName("TT8", comparison::StartsWithIgnoreCase);
|
||||
@@ -40,6 +39,7 @@ class SoleF85TreadmillTestData : public BluetoothDeviceTestData {
|
||||
public:
|
||||
SoleF85TreadmillTestData() : BluetoothDeviceTestData("Sole F85 Treadmill") {
|
||||
this->addDeviceName("F85", comparison::StartsWithIgnoreCase);
|
||||
this->addDeviceName("F80", comparison::StartsWithIgnoreCase);
|
||||
}
|
||||
|
||||
deviceType get_expectedDeviceType() const override { return deviceType::SoleF80Treadmill; }
|
||||
|
||||
Reference in New Issue
Block a user