Compare commits

...

45 Commits

Author SHA1 Message Date
Roberto Viola
1aefcad427 Update project.pbxproj 2025-02-11 15:38:09 +01:00
Roberto Viola
3f231ea1d1 Update project.pbxproj 2025-02-11 15:37:42 +01:00
Roberto Viola
8d28e3db6c Merge branch 'master' into tacx_wheel_diameter 2025-02-11 15:27:00 +01:00
Roberto Viola
2e50a25d21 Update ftmsbike.cpp 2025-02-11 14:34:43 +01:00
Roberto Viola
ff2c4fb9a9 Update ftmsbike.h 2025-02-11 14:34:25 +01:00
Roberto Viola
1d9b6be94e Update tacxneo2.cpp 2025-02-11 14:28:32 +01:00
Roberto Viola
73bc31ede1 Merge branch 'master' into tacx_wheel_diameter 2025-02-11 14:12:47 +01:00
Roberto Viola
97d65567dc Update tacxneo2.cpp 2024-12-13 12:57:00 +01:00
Roberto Viola
83c6e7c62d Merge branch 'master' into tacx_wheel_diameter 2024-12-13 12:02:50 +01:00
Roberto Viola
401e7210ca Merge branch 'master' into tacx_wheel_diameter 2024-12-13 10:44:58 +01:00
Roberto Viola
5f0ebd35e0 Update tacxneo2.cpp 2024-12-13 10:22:15 +01:00
Roberto Viola
c996212464 Merge branch 'master' into tacx_wheel_diameter 2024-12-13 10:20:12 +01:00
Roberto Viola
fae60c1566 fixing first resistance? 2024-12-13 09:16:31 +01:00
Roberto Viola
47b0b05c31 Update tacxneo2.cpp 2024-12-11 16:35:24 +01:00
Roberto Viola
438782acdc fixing wheel changing sending a fake inclination on init 2024-12-11 13:57:20 +01:00
Roberto Viola
824d2e2e77 Merge branch 'master' into tacx_wheel_diameter 2024-12-11 13:55:24 +01:00
Roberto Viola
f350837370 inclination is always requires for changing gears 2024-12-11 09:45:54 +01:00
Roberto Viola
0c3051c376 Merge branch 'master' into tacx_wheel_diameter 2024-12-11 09:42:37 +01:00
Roberto Viola
056424ef07 Merge branch 'master' into tacx_wheel_diameter 2024-12-10 09:32:51 +01:00
Roberto Viola
f3d8b3964c Merge branch 'master' into tacx_wheel_diameter 2024-11-09 15:37:11 +01:00
Roberto Viola
06253998ee Update wahookickrsnapbike.cpp 2024-11-04 15:08:26 +01:00
Roberto Viola
dbb9ba3510 implementing 2024-11-04 14:31:58 +01:00
Roberto Viola
ad802f7d2d Merge branch 'master' into tacx_wheel_diameter 2024-11-04 14:28:42 +01:00
Roberto Viola
9cc02dede9 ftms wheel circumference for gears 2024-10-30 15:57:31 +01:00
Roberto Viola
82a6afe6b6 kickr core to wahookickr class 2024-10-29 12:28:13 +01:00
Roberto Viola
a7b8e63235 fixing UI and settings 2024-10-29 08:50:33 +01:00
Roberto Viola
d7c3a84adb adding max and minGears 2024-10-29 08:21:59 +01:00
Roberto Viola
64b9ec9d72 fixing gear conversion 2024-10-29 08:17:38 +01:00
Roberto Viola
379cf8d7de Update project.pbxproj 2024-10-29 08:02:08 +01:00
Roberto Viola
2f2989f90d completed? 2024-10-28 15:40:00 +01:00
Roberto Viola
6fac9770be qml finally saves the settings correctly 2024-10-28 15:09:13 +01:00
Roberto Viola
8d07d7c3f7 Merge branch 'master' into Custom-gearing-ranges/ratios-(Discussion-#2671) 2024-10-28 13:44:31 +01:00
Roberto Viola
f85f743499 i need to save the first 3 static objects and use it in the wahoo module 2024-10-28 11:11:05 +01:00
Roberto Viola
74c37f5624 Update gears.qml 2024-10-28 09:46:58 +01:00
Roberto Viola
527396eafc Revert "Update gears.qml"
This reverts commit 0f149448b3.
2024-10-28 09:18:54 +01:00
Roberto Viola
0f149448b3 Update gears.qml 2024-10-25 16:28:33 +02:00
Roberto Viola
ed1599ca8e need to center the values in the table 2024-10-24 15:08:25 +02:00
Roberto Viola
89808ae65b fixing casting to double 2024-10-24 11:15:51 +02:00
Roberto Viola
2da194f073 Merge branch 'master' into Custom-gearing-ranges/ratios-(Discussion-#2671) 2024-10-24 11:00:46 +02:00
Roberto Viola
d712621b7b fixing formula 2024-10-23 11:47:05 +02:00
Roberto Viola
1c06260036 Merge branch 'master' into Custom-gearing-ranges/ratios-(Discussion-#2671) 2024-10-23 11:44:26 +02:00
Roberto Viola
2d1364497e Update virtualbike_zwift.swift 2024-10-22 15:40:04 +02:00
Roberto Viola
cc7757bfcd Update project.pbxproj 2024-10-22 15:38:44 +02:00
Roberto Viola
49c7a96c81 Merge branch 'master' into Custom-gearing-ranges/ratios-(Discussion-#2671) 2024-10-22 15:32:50 +02:00
Roberto Viola
05d598ffcf first raw version 2024-10-21 14:06:48 +02:00
3 changed files with 26 additions and 12 deletions

View File

@@ -4233,7 +4233,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = "../src/ios/qdomyos-zwift.entitlements";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1023;
CURRENT_PROJECT_VERSION = 1025;
DEVELOPMENT_TEAM = 6335M7T29D;
ENABLE_BITCODE = NO;
GCC_PREPROCESSOR_DEFINITIONS = "ADB_HOST=1";
@@ -4427,7 +4427,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = "../src/ios/qdomyos-zwift.entitlements";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1023;
CURRENT_PROJECT_VERSION = 1025;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = 6335M7T29D;
ENABLE_BITCODE = NO;
@@ -4657,7 +4657,7 @@
CODE_SIGN_ENTITLEMENTS = "watchkit Extension/WatchKit Extension.entitlements";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1023;
CURRENT_PROJECT_VERSION = 1025;
DEVELOPMENT_TEAM = 6335M7T29D;
ENABLE_BITCODE = YES;
ENABLE_STRICT_OBJC_MSGSEND = YES;
@@ -4753,7 +4753,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_ENTITLEMENTS = "watchkit Extension/WatchKit Extension.entitlements";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1023;
CURRENT_PROJECT_VERSION = 1025;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = 6335M7T29D;
ENABLE_BITCODE = YES;
@@ -4845,7 +4845,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_ENTITLEMENTS = "watchkit Extension/WatchKit Extension.entitlements";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1023;
CURRENT_PROJECT_VERSION = 1025;
DEVELOPMENT_ASSET_PATHS = "\"watchkit Extension/Preview Content\"";
ENABLE_BITCODE = YES;
ENABLE_PREVIEWS = YES;
@@ -4961,7 +4961,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_ENTITLEMENTS = "watchkit Extension/WatchKit Extension.entitlements";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1023;
CURRENT_PROJECT_VERSION = 1025;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_ASSET_PATHS = "\"watchkit Extension/Preview Content\"";
ENABLE_BITCODE = YES;

View File

@@ -7,6 +7,7 @@
#include <QSettings>
#include <QThread>
#include <math.h>
#include "wheelcircumference.h"
#ifdef Q_OS_ANDROID
#include "keepawakehelper.h"
#include <QLowEnergyConnectionParameters>
@@ -91,6 +92,7 @@ void tacxneo2::forceInclination(double inclination) {
inc[12]++;
writeCharacteristic(inc, sizeof(inc), QStringLiteral("changeInclination"), false, false);
resistance_sent = true;
}
void tacxneo2::update() {
@@ -106,6 +108,7 @@ void tacxneo2::update() {
settings.value(QZSettings::tacx_neo2_peloton, QZSettings::default_tacx_neo2_peloton).toBool();
if (tacx_neo2_peloton)
requestInclination = 0;
initDone = true;
} else if (bluetoothDevice.isValid() &&
m_control->state() == QLowEnergyController::DiscoveredState //&&
// gattCommunicationChannelService &&
@@ -123,7 +126,7 @@ void tacxneo2::update() {
auto virtualBike = this->VirtualBike();
if (requestResistance != -1) {
if (requestResistance != currentResistance().value() || lastGearValue != gears()) {
if (requestResistance != currentResistance().value()) {
emit debug(QStringLiteral("writing resistance ") + QString::number(requestResistance));
if (((virtualBike && !virtualBike->ftmsDeviceConnected()) || !virtualBike) &&
(requestPower == 0 || requestPower == -1)) {
@@ -135,16 +138,25 @@ void tacxneo2::update() {
}
if (requestInclination != -100) {
emit debug(QStringLiteral("writing inclination ") + QString::number(requestInclination));
forceInclination(requestInclination + gears()); // since this bike doesn't have the concept of resistance,
forceInclination(requestInclination); // since this bike doesn't have the concept of resistance,
// i'm using the gears in the inclination
requestInclination = -100;
} else if((virtualBike && virtualBike->ftmsDeviceConnected()) && lastGearValue != gears() && lastRawRequestedInclinationValue != -100) {
} else if((virtualBike && virtualBike->ftmsDeviceConnected()) && lastRawRequestedInclinationValue != -100) {
// in order to send the new gear value ASAP
forceInclination(lastRawRequestedInclinationValue + gears()); // since this bike doesn't have the concept of resistance,
forceInclination(lastRawRequestedInclinationValue); // since this bike doesn't have the concept of resistance,
// i'm using the gears in the inclination
}
lastGearValue = gears();
if(lastGearValue != gears()) {
if(Cadence.value() > 0) { // this trainer can change gears only if the wattage is greater than 0 and if you send at least once an inclination
if(!resistance_sent) {
forceInclination(1.0);
} else {
setUserConfiguration(wheelCircumference::gearsToWheelDiameter(gears()), 1);
lastGearValue = gears();
}
}
}
if (requestPower != -1) {
changePower(requestPower);
@@ -953,6 +965,7 @@ void tacxneo2::controllerStateChanged(QLowEnergyController::ControllerState stat
if (state == QLowEnergyController::UnconnectedState && m_control) {
qDebug() << QStringLiteral("trying to connect back again...");
initDone = false;
resistance_sent = false;
m_control->connectToDevice();
}
}
@@ -988,7 +1001,7 @@ void tacxneo2::setUserConfiguration(double wheelDiameter, double gearRatio) {
float userWeight = settings.value(QZSettings::weight, QZSettings::default_weight).toFloat();
// Prepare the command bytes according to FE-C protocol
uint8_t config[] = {0xA4, 0x09, 0x4E, 0x05, 0x37, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00};
uint8_t config[] = {0xA4, 0x09, 0x4F, 0x05, 0x37, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00};
// Convert user weight to protocol format (2 bytes, weight/0.01)
uint16_t weightValue = static_cast<uint16_t>(userWeight / 0.01);

View File

@@ -80,6 +80,7 @@ class tacxneo2 : public bike {
double lastGearValue = -1;
bool resistance_received = false;
bool resistance_sent = false;
bool THINK_X = false;