mirror of
https://github.com/cagnulein/qdomyos-zwift.git
synced 2026-02-18 00:17:41 +01:00
Compare commits
20 Commits
opencv_and
...
android_CI
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e48af4e864 | ||
|
|
e990a27f65 | ||
|
|
4c88304be0 | ||
|
|
4c1d39d68c | ||
|
|
efc92f72b2 | ||
|
|
424e21a8fa | ||
|
|
51bc2ffb48 | ||
|
|
7cfd1ba93b | ||
|
|
c01e5ccb14 | ||
|
|
dd495f1a76 | ||
|
|
458c44758e | ||
|
|
78e3a33596 | ||
|
|
77a9fc718a | ||
|
|
be12859343 | ||
|
|
d201919b55 | ||
|
|
138a42c2e6 | ||
|
|
bbe69f3f60 | ||
|
|
b95b3a5018 | ||
|
|
fb0cbb74a5 | ||
|
|
deed6019ab |
48
.github/workflows/main.yml
vendored
48
.github/workflows/main.yml
vendored
@@ -513,7 +513,7 @@ jobs:
|
||||
- name: Install Qt Android
|
||||
uses: jurplel/install-qt-action@v3
|
||||
with:
|
||||
version: '5.15.2'
|
||||
version: '5.15.0'
|
||||
host: 'linux'
|
||||
target: 'android'
|
||||
arch: 'android'
|
||||
@@ -527,6 +527,9 @@ jobs:
|
||||
with:
|
||||
distribution: 'temurin' # See 'Supported distributions' for available options
|
||||
java-version: '11'
|
||||
|
||||
- name: patching qt for bluetooth
|
||||
run: cp qt-patches/android/5.15.0/jar/*.* ${{ github.workspace }}/output/android/Qt/5.15.0/android/jar/
|
||||
|
||||
- name: Set Android NDK 21 && build
|
||||
run: |
|
||||
@@ -538,6 +541,12 @@ jobs:
|
||||
echo "y" | $SDKMANAGER "ndk;21.4.7075529"
|
||||
export ANDROID_NDK="${ANDROID_SDK_ROOT}/ndk-bundle"
|
||||
export ANDROID_NDK_ROOT="${ANDROID_NDK}"
|
||||
cd src
|
||||
echo "#define STRAVA_SECRET_KEY ${{ secrets.strava_secret_key }}" > secret.h
|
||||
echo "#define SMTP_USERNAME ${{ secrets.smtp_username }}" >> secret.h
|
||||
echo "#define SMTP_PASSWORD ${{ secrets.smtp_password }}" >> secret.h
|
||||
echo "#define SMTP_SERVER ${{ secrets.smtp_server }}" >> secret.h
|
||||
cd ..
|
||||
|
||||
ln -sfn $ANDROID_SDK_ROOT/ndk/21.4.7075529 $ANDROID_NDK
|
||||
rm -rf /usr/local/lib/android/sdk/ndk/25.1.8937393
|
||||
@@ -546,6 +555,43 @@ jobs:
|
||||
- name: Build APK (not usable for production due to unpatched QT library)
|
||||
run: cd src; androiddeployqt --input android-qdomyos-zwift-deployment-settings.json --output ${{ github.workspace }}/output/android/ --android-platform android-31 --gradle --aab
|
||||
|
||||
- uses: r0adkll/sign-android-release@v1
|
||||
name: Sign app APK
|
||||
# ID used to access action output
|
||||
id: sign_app
|
||||
with:
|
||||
releaseDirectory: ${{ github.workspace }}/output/android/build/outputs/apk/debug/
|
||||
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
|
||||
alias: ${{ secrets.ALIAS }}
|
||||
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
|
||||
keyPassword: ${{ secrets.KEY_PASSWORD }}
|
||||
env:
|
||||
# override default build-tools version (29.0.3) -- optional
|
||||
BUILD_TOOLS_VERSION: "30.0.2"
|
||||
|
||||
- uses: r0adkll/sign-android-release@v1
|
||||
name: Sign app AAB
|
||||
# ID used to access action output
|
||||
id: sign_aab
|
||||
with:
|
||||
releaseDirectory: ${{ github.workspace }}/output/android/build/outputs/bundle/debug/
|
||||
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
|
||||
alias: ${{ secrets.ALIAS }}
|
||||
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
|
||||
keyPassword: ${{ secrets.KEY_PASSWORD }}
|
||||
env:
|
||||
# override default build-tools version (29.0.3) -- optional
|
||||
BUILD_TOOLS_VERSION: "30.0.2"
|
||||
|
||||
- uses: r0adkll/upload-google-play@v1
|
||||
with:
|
||||
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }}
|
||||
packageName: org.cagnulen.qdomyoszwift
|
||||
releaseFiles: ${{steps.sign_aab.outputs.signedReleaseFile}}
|
||||
track: internal
|
||||
status: draft
|
||||
inAppUpdatePriority: 2
|
||||
|
||||
ios-build:
|
||||
# The type of runner that the job will run on
|
||||
runs-on: macos-latest
|
||||
|
||||
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.13.99" android:versionCode="615" 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 -->
|
||||
|
||||
@@ -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) {
|
||||
@@ -5959,6 +5962,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.13.99"
|
||||
width: parent.width
|
||||
}
|
||||
|
||||
|
||||
@@ -812,4 +812,4 @@ INCLUDEPATH += purchasing/inapp
|
||||
|
||||
WINRT_MANIFEST = AppxManifest.xml
|
||||
|
||||
VERSION = 2.13.98
|
||||
VERSION = 2.13.99
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user