mirror of
https://github.com/cagnulein/qdomyos-zwift.git
synced 2026-02-18 00:17:41 +01:00
Compare commits
45 Commits
ant-remote
...
tacx_wheel
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1aefcad427 | ||
|
|
3f231ea1d1 | ||
|
|
8d28e3db6c | ||
|
|
2e50a25d21 | ||
|
|
ff2c4fb9a9 | ||
|
|
1d9b6be94e | ||
|
|
73bc31ede1 | ||
|
|
97d65567dc | ||
|
|
83c6e7c62d | ||
|
|
401e7210ca | ||
|
|
5f0ebd35e0 | ||
|
|
c996212464 | ||
|
|
fae60c1566 | ||
|
|
47b0b05c31 | ||
|
|
438782acdc | ||
|
|
824d2e2e77 | ||
|
|
f350837370 | ||
|
|
0c3051c376 | ||
|
|
056424ef07 | ||
|
|
f3d8b3964c | ||
|
|
06253998ee | ||
|
|
dbb9ba3510 | ||
|
|
ad802f7d2d | ||
|
|
9cc02dede9 | ||
|
|
82a6afe6b6 | ||
|
|
a7b8e63235 | ||
|
|
d7c3a84adb | ||
|
|
64b9ec9d72 | ||
|
|
379cf8d7de | ||
|
|
2f2989f90d | ||
|
|
6fac9770be | ||
|
|
8d07d7c3f7 | ||
|
|
f85f743499 | ||
|
|
74c37f5624 | ||
|
|
527396eafc | ||
|
|
0f149448b3 | ||
|
|
ed1599ca8e | ||
|
|
89808ae65b | ||
|
|
2da194f073 | ||
|
|
d712621b7b | ||
|
|
1c06260036 | ||
|
|
2d1364497e | ||
|
|
cc7757bfcd | ||
|
|
49c7a96c81 | ||
|
|
05d598ffcf |
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -80,6 +80,7 @@ class tacxneo2 : public bike {
|
||||
|
||||
double lastGearValue = -1;
|
||||
bool resistance_received = false;
|
||||
bool resistance_sent = false;
|
||||
|
||||
bool THINK_X = false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user