cagnulein / QZCompanionNordictrackTreadmill

Companion App of QZ for Nordictrack Treadmills and Bikes
https://www.qzfitness.com/
GNU Affero General Public License v3.0
43 stars 12 forks source link

Incline and speed support for Nordictrack C1750 2020 #81

Closed jhholen closed 5 months ago

jhholen commented 7 months ago

Nordictrack C1750 with 10" screen needs mapping for adjustment of speed and incline.

Controls added to the screen and I can see touch events on the screen when changing speed in the app.

Please let me know if I can contribute with anything.

IMG_4708

jhholen commented 7 months ago

Never mind - forgot to edit type the app.

cagnulein commented 7 months ago

@jhholen So it's already OK?

jhholen commented 7 months ago

Speed works fine and adding incline works. But lowering incline dosent work to me. No action on the mill.

Edit: works only some of the times I click

cagnulein commented 7 months ago

Could you please share a debug log with the issue https://github.com/cagnulein/qdomyos-zwift/wiki/How-do-i-get-the-debug-log-in-case-something-doesn't-work%3F

jhholen commented 7 months ago

[Uploading debug-Fri_Feb_2_18_32_10_2024.log…]()

cagnulein commented 7 months ago

Wait the finish of the upload before commenting, the file is truncated

jhholen commented 7 months ago

debug-Fri_Feb_2_18_32_10_2024.log

Better?

BTW: what is the latest Version of IFIT that works with the qz app?

cagnulein commented 7 months ago

Thanks I will check it ASAP

I don't know about the ifit version, it depends on the specific model. You have to try

Roberto Viola Software engineer and open source enthusiast http://robertoviola.cloud

Il giorno ven 2 feb 2024 alle 18:43 Jarl-Håvard Holen < @.***> ha scritto:

debug-Fri_Feb_2_18_32_10_2024.log https://github.com/cagnulein/QZCompanionNordictrackTreadmill/files/14143379/debug-Fri_Feb_2_18_32_10_2024.log

Better?

BTW: what is the latest Version of IFIT that works with the qz app?

— Reply to this email directly, view it on GitHub https://github.com/cagnulein/QZCompanionNordictrackTreadmill/issues/81#issuecomment-1924391538, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAALYWFZKJKETRRNPIWZ4R3YRUQSRAVCNFSM6AAAAABCXBEEZ2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMRUGM4TCNJTHA . You are receiving this because you commented.Message ID: @.*** com>

cagnulein commented 7 months ago

Can you try setting 1 to inclination step in the treadmill settings in qz?

I guess the issue is about 0.5 step

By the way which device are you using in the companion?

jhholen commented 7 months ago

Tried setting incline step to 1, without any luck.

Today it does not work at all. Probably not related to the change, but more due to reboot of the machine.

Using iOS.

cagnulein commented 7 months ago

i mean the device selected on the companion.

anyway yes try to reboot it and check that the adb setting is still enabled

jhholen commented 7 months ago

I have selected C1750 2021. Where do I check the adb setting?

cagnulein commented 7 months ago

didn't you follow this https://github.com/cagnulein/QZCompanionNordictrackTreadmill ?

anyway if it was working before without the adb , yes i suggest to only reboot the treadmill

Roberto Viola Software engineer and open source enthusiast http://roberto viola.cloud http://robertoviola.cloud

Il giorno sab 3 feb 2024 alle 18:30 Jarl-Håvard Holen < @.***> ha scritto:

I have selected C1750 2021. Where do I check the adb setting?

— Reply to this email directly, view it on GitHub https://github.com/cagnulein/QZCompanionNordictrackTreadmill/issues/81#issuecomment-1925407297, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAALYWANJFFI4MGD4XJUUSDYRZX4LAVCNFSM6AAAAABCXBEEZ2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMRVGQYDOMRZG4 . You are receiving this because you commented.Message ID: @.*** com>

jhholen commented 7 months ago

Yes, I did.

Will try that and report back.

cagnulein commented 7 months ago

ok also remove the gateway setting from the wifi setting of the treadmill so ifit will not try to fix themself

jhholen commented 7 months ago

What gateway setting?

See now that iFit has updated itself automatically...

cagnulein commented 7 months ago

@jhholen in the wifi settings of the treadmill don't you see the ip and the gateway? share me a screenshot of them

jhholen commented 7 months ago

IMG_4717

debug-Sun_Feb_4_09_00_37_2024.log

But I can see now that ifit has updated. Can that be the reason why the controls dont work?

cagnulein commented 7 months ago

Yes it could be. That's why I'm always asking to reset the factory reset and removing the gateway immediately so ifit will not update itself

jhholen commented 7 months ago

Where is the gateway process described?

cagnulein commented 7 months ago

Actually nowhere but you can find here in the tickets there are some comments about this.

Did you find the wifi settings of the treadmill?

I'm on a family meeting now, I will help you in the next hours if you can't find it

Roberto Viola Software engineer and open source enthusiast http://robertoviola.cloud

Il giorno dom 4 feb 2024 alle 12:52 Jarl-Håvard Holen < @.***> ha scritto:

Where is the gateway process described?

— Reply to this email directly, view it on GitHub https://github.com/cagnulein/QZCompanionNordictrackTreadmill/issues/81#issuecomment-1925721634, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAALYWG67S5DPMJTLJPBBOLYR5ZBVAVCNFSM6AAAAABCXBEEZ2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMRVG4ZDCNRTGQ . You are receiving this because you commented.Message ID: @.*** com>

jhholen commented 7 months ago

Just reset the treadmill now, and reinstalled the app. C1750 selected.

The speed works, but the steps are off. Increments by 0.2 instead of 0.5.

Incline works sort of the first three clicks. Setting is set to one, but incline changes by two. Minus also increases incline. After three clicks it dosent work anymore.

See attached video.

https://github.com/cagnulein/QZCompanionNordictrackTreadmill/assets/6086258/634de117-8f33-4303-92f3-25d2b1c2aa1c

Data flows right.

cagnulein commented 7 months ago

Ok so I need to map your device, use this https://github.com/cagnulein/QZCompanionNordictrackTreadmill/blob/master/InstallPackage/adb-screenshot.bat

jhholen commented 7 months ago

On a Mac only.

Possible to rewrite to bash?

cagnulein commented 7 months ago

Check here https://github.com/cagnulein/QZCompanionNordictrackTreadmill/blob/master/InstallPackage/adb-screenshot-mac.sh

Roberto Viola Software engineer and open source enthusiast http://robertoviola.cloud

Il giorno dom 4 feb 2024 alle 21:57 Jarl-Håvard Holen < @.***> ha scritto:

On a Mac only.

Possible to rewrite to bash?

— Reply to this email directly, view it on GitHub https://github.com/cagnulein/QZCompanionNordictrackTreadmill/issues/81#issuecomment-1925911908, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAALYWAYMYNRCYY7IEHOO2LYR7Y4ZAVCNFSM6AAAAABCXBEEZ2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMRVHEYTCOJQHA . You are receiving this because you commented.Message ID: @.*** com>

jhholen commented 7 months ago

Rewrote it myself. Screenshot added.

2024-02-04@22-06-31

cagnulein commented 7 months ago

Ok I will add this in the next days

cagnulein commented 7 months ago

@jhholen new apk https://github.com/cagnulein/QZCompanionNordictrackTreadmill/releases/download/3.3.36/QZCompanionNordictrackTreadmill.apk

let me know if the formula is right now, otherwise we need to test it with adb to find the right coefficents. let me know!

jhholen commented 7 months ago

Incline gives 0,5 - 1,5 - 3,5 and 7,5 with each click. Decline does not work (hits somewhere else on the screen.

Speed is sometimes increased by 0.4 and some 0.1.

cagnulein commented 7 months ago

ok so I need help from you. You need to create a formula yourself testing directly on the treadmill. Are you able to to so?

you have to use the

adb shell input swipe

command

with the coordinates

you can check here the formula that I added for you https://github.com/cagnulein/QZCompanionNordictrackTreadmill/commit/c884a174fcd8f900a55288162d38f2cbb45ce644#diff-f6d77d1e4eb75018758ba6c75c8ba2c8e817dd8a5d5790ae376f74b0a4dddd92

Let me know if you have any questions!

jhholen commented 7 months ago

Sure!

Can you give me an example command with coordinates?

adb shell input swipe 1234 ?

cagnulein commented 7 months ago

for the inclination, for example

adb shell input swipe x1 y1Inclination x1 y2 200

where

x1 = 75

y1Incliantion is the start point of the current inclination value calculated in pixel coordinates. I-m calculating this in this way now 594 - (int) ((QZService.lastInclinationFloat -3) * 19.83); The QZService.lastInclinationFloat is the actual inclination grade collect from the treadmill

y2 i'm calculating it in this way now y1Inclination - (int) ((reqInclination - QZService.lastInclinationFloat) * 19.83); the reqinclination is the value in grade that you want to set to the treadmill

let me know

jhholen commented 7 months ago

Thanks. Will come back to you next week. :)

jhholen commented 6 months ago

Was going to configure the setup now, but the screen on my treadmill once again goes white (iFit app) after a few days without use. This has happened three times lately, and the solution looks to be either reset the machine or update iFit.

Known issue?

cagnulein commented 6 months ago

Never heard it.

Anyway you can use this method to bypass the screen https://github.com/cagnulein/QZCompanionNordictrackTreadmill/issues/79#issuecomment-1934430677

Roberto Viola Software engineer and open source enthusiast http://robertoviola.cloud

Il giorno mar 13 feb 2024 alle 17:59 Jarl-Håvard Holen < @.***> ha scritto:

Was going to configure the setup now, but the screen on my treadmill once again goes white after a few days without use. This has happened three times lately, and the solution looks to be either reset the machine or update iFit.

Known issue?

— Reply to this email directly, view it on GitHub https://github.com/cagnulein/QZCompanionNordictrackTreadmill/issues/81#issuecomment-1942010582, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAALYWD6P6U5ALQE3KMHHG3YTOLYZAVCNFSM6AAAAABCXBEEZ2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNBSGAYTANJYGI . You are receiving this because you commented.Message ID: @.*** com>

jhholen commented 6 months ago

Thank you, but the issue is related to the iFit app. I can navigate the Android interface, restart the app and close. But iFit ends up in a white screen each time.

From: Roberto Viola @.> @.> Reply: cagnulein/QZCompanionNordictrackTreadmill @.> @.> Date: 13 February 2024 at 18:01:45 To: cagnulein/QZCompanionNordictrackTreadmill @.> @.> CC: Jarl-Håvard Holen @.> @.>, Mention @.> @.> Subject: Re: [cagnulein/QZCompanionNordictrackTreadmill] Incline and speed support for Nordictrack C1750 2020 (Issue #81)

Never heard it.

Anyway you can use this method to bypass the screen

https://github.com/cagnulein/QZCompanionNordictrackTreadmill/issues/79#issuecomment-1934430677

Roberto Viola Software engineer and open source enthusiast http://robertoviola.cloud

Il giorno mar 13 feb 2024 alle 17:59 Jarl-Håvard Holen < @.***> ha scritto:

Was going to configure the setup now, but the screen on my treadmill once again goes white after a few days without use. This has happened three times lately, and the solution looks to be either reset the machine or update iFit.

Known issue?

— Reply to this email directly, view it on GitHub < https://github.com/cagnulein/QZCompanionNordictrackTreadmill/issues/81#issuecomment-1942010582>,

or unsubscribe < https://github.com/notifications/unsubscribe-auth/AAALYWD6P6U5ALQE3KMHHG3YTOLYZAVCNFSM6AAAAABCXBEEZ2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNBSGAYTANJYGI>

. You are receiving this because you commented.Message ID: @.*** com>

— Reply to this email directly, view it on GitHub https://github.com/cagnulein/QZCompanionNordictrackTreadmill/issues/81#issuecomment-1942014234, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABON44VPBX6WHJXQS43IRJTYTOL7TAVCNFSM6AAAAABCXBEEZ2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNBSGAYTIMRTGQ . You are receiving this because you were mentioned.Message ID: @.*** com>

cagnulein commented 6 months ago

argh this is new. maybe you can try to install a different ifit apk version?

Roberto Viola Software engineer and open source enthusiast http://robertoviola.cloud

Il giorno mar 13 feb 2024 alle 18:08 Jarl-Håvard Holen < @.***> ha scritto:

Thank you, but the issue is related to the iFit app. I can navigate the Android interface, restart the app and close. But iFit ends up in a white screen each time.

From: Roberto Viola @.> @.> Reply: cagnulein/QZCompanionNordictrackTreadmill @.> @.> Date: 13 February 2024 at 18:01:45 To: cagnulein/QZCompanionNordictrackTreadmill @.> @.> CC: Jarl-Håvard Holen @.> @.>, Mention @.> @.> Subject: Re: [cagnulein/QZCompanionNordictrackTreadmill] Incline and speed support for Nordictrack C1750 2020 (Issue #81)

Never heard it.

Anyway you can use this method to bypass the screen

https://github.com/cagnulein/QZCompanionNordictrackTreadmill/issues/79#issuecomment-1934430677

Roberto Viola Software engineer and open source enthusiast http://robertoviola.cloud

Il giorno mar 13 feb 2024 alle 17:59 Jarl-Håvard Holen < @.***> ha scritto:

Was going to configure the setup now, but the screen on my treadmill once again goes white after a few days without use. This has happened three times lately, and the solution looks to be either reset the machine or update iFit.

Known issue?

— Reply to this email directly, view it on GitHub <

https://github.com/cagnulein/QZCompanionNordictrackTreadmill/issues/81#issuecomment-1942010582>,

or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AAALYWD6P6U5ALQE3KMHHG3YTOLYZAVCNFSM6AAAAABCXBEEZ2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNBSGAYTANJYGI>

. You are receiving this because you commented.Message ID: @.*** com>

— Reply to this email directly, view it on GitHub < https://github.com/cagnulein/QZCompanionNordictrackTreadmill/issues/81#issuecomment-1942014234>,

or unsubscribe < https://github.com/notifications/unsubscribe-auth/ABON44VPBX6WHJXQS43IRJTYTOL7TAVCNFSM6AAAAABCXBEEZ2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNBSGAYTIMRTGQ>

. You are receiving this because you were mentioned.Message ID: @.*** com>

— Reply to this email directly, view it on GitHub https://github.com/cagnulein/QZCompanionNordictrackTreadmill/issues/81#issuecomment-1942025885, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAALYWBJDHMS7UKXI75DE5LYTOMYHAVCNFSM6AAAAABCXBEEZ2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNBSGAZDKOBYGU . You are receiving this because you commented.Message ID: @.*** com>

jhholen commented 6 months ago

Did a reset and did some testing.

Can the issue be that the speed start with 1,3,5,7,9,11 and then changes to 12,14,16,18,20,22? Wont the formula then be off?

Same goes for incline: -3, -1, 0, 2, 4, 5, 7, 8, 10, 12, 13, 15. 2024-02-13@18-20-14

cagnulein commented 6 months ago

Could be, are you able to change the formula So? You can start trying to change the speed value starting from 1 to any new speed and creating a table like the user did in the link that I just sent

jhholen commented 6 months ago

Added a list with incline values now, and tried to create a function. Wasn't able to push the feature, but added the functions below.

private int c1750_2020_kph_inclination_lookuptable(double reqInclination) {
        int y2 = 0;
        if (reqInclination == -3) { y2 = 592; }
        else if (reqInclination == -2.5) { y2 = 584; }
        else if (reqInclination == -2) { y2 = 576; }
        else if (reqInclination == -1.5) { y2 = 568; }
        else if (reqInclination == -1) { y2 = 560; }
        else if (reqInclination == -0.5) { y2 = 544; }
        else if (reqInclination == 0) { y2 = 528; }
        else if (reqInclination == 0.5) { y2 = 520; }
        else if (reqInclination == 1) { y2 = 512; }
        else if (reqInclination == 1.5) { y2 = 504; }
        else if (reqInclination == 2) { y2 = 496; }
        else if (reqInclination == 2.5) { y2 = 488; }
        else if (reqInclination == 3) { y2 = 480; }
        else if (reqInclination == 3.5) { y2 = 472; }
        else if (reqInclination == 4) { y2 = 464; }
        else if (reqInclination == 4.5) { y2 = 456; }
        else if (reqInclination == 5) { y2 = 448; }
        else if (reqInclination == 5.5) { y2 = 440; }
        else if (reqInclination == 6) { y2 = 432; }
        else if (reqInclination == 6.5) { y2 = 424; }
        else if (reqInclination == 7) { y2 = 400; }
        else if (reqInclination == 7.5) { y2 = 384; }
        else if (reqInclination == 8) { y2 = 368; }
        else if (reqInclination == 8.5) { y2 = 360; }
        else if (reqInclination == 9) { y2 = 352; }
        else if (reqInclination == 9.5) { y2 = 344; }
        else if (reqInclination == 10) { y2 = 336; }
        else if (reqInclination == 10.5) { y2 = 328; }
        else if (reqInclination == 11) { y2 = 320; }
        else if (reqInclination == 11.5) { y2 = 312; }
        else if (reqInclination == 12) { y2 = 304; }
        else if (reqInclination == 12.5) { y2 = 288; }
        else if (reqInclination == 13) { y2 = 272; }
        else if (reqInclination == 13.5) { y2 = 264; }
        else if (reqInclination == 14) { y2 = 256; }
        else if (reqInclination == 14.5) { y2 = 248; }
        else if (reqInclination == 15) { y2 = 240; }
        return y2;        
    }

    private int c1750_2020_kph_speed_function(double reqSpeed) {
        int y1BaseSpeed = 592; // Slider at 1kmh
        int y2 = 0;

        // Returns slider position of required speed in pixels.
        if (reqSpeed <= 11) {
            // If speed is 11kmh or less
            y2 = reqSpeed + (16-(16 * y1BaseSpeed));
        } else if (reqSpeed > 11 && reqSpeed < 12) {
            // If speed is more than 11kmh or less than 12kmh
            y2 = reqSpeed + (8-(16 * y1BaseSpeed));
        } else if (reqSpeed >= 12) {
            // If speed is 12kmh or more
            y2 = reqSpeed + (0-(16 * y1BaseSpeed));
        }

        return y2;
    }
cagnulein commented 6 months ago

Looks great! I will add it tomorrow!

Il giorno mar 20 feb 2024 alle 17:03 Jarl-Håvard Holen < @.***> ha scritto:

Added a list with incline values now, and tried to create a function. Wasn't able to push the feature, but added the functions below.

private int c1750_2020_kph_inclination_lookuptable(double reqInclination) { int y2 = 0; if (reqInclination == -3) { y2 = 592; } else if (reqInclination == -2.5) { y2 = 584; } else if (reqInclination == -2) { y2 = 576; } else if (reqInclination == -1.5) { y2 = 568; } else if (reqInclination == -1) { y2 = 560; } else if (reqInclination == -0.5) { y2 = 544; } else if (reqInclination == 0) { y2 = 528; } else if (reqInclination == 0.5) { y2 = 520; } else if (reqInclination == 1) { y2 = 512; } else if (reqInclination == 1.5) { y2 = 504; } else if (reqInclination == 2) { y2 = 496; } else if (reqInclination == 2.5) { y2 = 488; } else if (reqInclination == 3) { y2 = 480; } else if (reqInclination == 3.5) { y2 = 472; } else if (reqInclination == 4) { y2 = 464; } else if (reqInclination == 4.5) { y2 = 456; } else if (reqInclination == 5) { y2 = 448; } else if (reqInclination == 5.5) { y2 = 440; } else if (reqInclination == 6) { y2 = 432; } else if (reqInclination == 6.5) { y2 = 424; } else if (reqInclination == 7) { y2 = 400; } else if (reqInclination == 7.5) { y2 = 384; } else if (reqInclination == 8) { y2 = 368; } else if (reqInclination == 8.5) { y2 = 360; } else if (reqInclination == 9) { y2 = 352; } else if (reqInclination == 9.5) { y2 = 344; } else if (reqInclination == 10) { y2 = 336; } else if (reqInclination == 10.5) { y2 = 328; } else if (reqInclination == 11) { y2 = 320; } else if (reqInclination == 11.5) { y2 = 312; } else if (reqInclination == 12) { y2 = 304; } else if (reqInclination == 12.5) { y2 = 288; } else if (reqInclination == 13) { y2 = 272; } else if (reqInclination == 13.5) { y2 = 264; } else if (reqInclination == 14) { y2 = 256; } else if (reqInclination == 14.5) { y2 = 248; } else if (reqInclination == 15) { y2 = 240; } return y2; }

private int c1750_2020_kph_speed_function(double reqSpeed) {
    int y1BaseSpeed = 592; // Slider at 1kmh
    int y2 = 0;

    // Returns slider position of required speed in pixels.
    if (reqSpeed <= 11) {
        // If speed is 11kmh or less
        y2 = reqSpeed + (16-(16 * y1BaseSpeed));
    } else if (reqSpeed > 11 && reqSpeed < 12) {
        // If speed is more than 11kmh or less than 12kmh
        y2 = reqSpeed + (8-(16 * y1BaseSpeed));
    } else if (reqSpeed >= 12) {
        // If speed is 12kmh or more
        y2 = reqSpeed + (0-(16 * y1BaseSpeed));
    }

    return y2;
}

— Reply to this email directly, view it on GitHub https://github.com/cagnulein/QZCompanionNordictrackTreadmill/issues/81#issuecomment-1954538261, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAALYWB672EYZYUEMFSITS3YUTCOZAVCNFSM6AAAAABCXBEEZ2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNJUGUZTQMRWGE . You are receiving this because you commented.Message ID: @.*** com>

cagnulein commented 6 months ago

new build ready, let me know https://github.com/cagnulein/QZCompanionNordictrackTreadmill/releases/download/3.3.40/QZCompanionNordictrackTreadmill.apk

Roberto Viola Software engineer and open source enthusiast http://robertoviola.cloud

Il giorno mar 20 feb 2024 alle 17:36 cagnulein @.***> ha scritto:

Looks great! I will add it tomorrow!

Il giorno mar 20 feb 2024 alle 17:03 Jarl-Håvard Holen < @.***> ha scritto:

Added a list with incline values now, and tried to create a function. Wasn't able to push the feature, but added the functions below.

private int c1750_2020_kph_inclination_lookuptable(double reqInclination) { int y2 = 0; if (reqInclination == -3) { y2 = 592; } else if (reqInclination == -2.5) { y2 = 584; } else if (reqInclination == -2) { y2 = 576; } else if (reqInclination == -1.5) { y2 = 568; } else if (reqInclination == -1) { y2 = 560; } else if (reqInclination == -0.5) { y2 = 544; } else if (reqInclination == 0) { y2 = 528; } else if (reqInclination == 0.5) { y2 = 520; } else if (reqInclination == 1) { y2 = 512; } else if (reqInclination == 1.5) { y2 = 504; } else if (reqInclination == 2) { y2 = 496; } else if (reqInclination == 2.5) { y2 = 488; } else if (reqInclination == 3) { y2 = 480; } else if (reqInclination == 3.5) { y2 = 472; } else if (reqInclination == 4) { y2 = 464; } else if (reqInclination == 4.5) { y2 = 456; } else if (reqInclination == 5) { y2 = 448; } else if (reqInclination == 5.5) { y2 = 440; } else if (reqInclination == 6) { y2 = 432; } else if (reqInclination == 6.5) { y2 = 424; } else if (reqInclination == 7) { y2 = 400; } else if (reqInclination == 7.5) { y2 = 384; } else if (reqInclination == 8) { y2 = 368; } else if (reqInclination == 8.5) { y2 = 360; } else if (reqInclination == 9) { y2 = 352; } else if (reqInclination == 9.5) { y2 = 344; } else if (reqInclination == 10) { y2 = 336; } else if (reqInclination == 10.5) { y2 = 328; } else if (reqInclination == 11) { y2 = 320; } else if (reqInclination == 11.5) { y2 = 312; } else if (reqInclination == 12) { y2 = 304; } else if (reqInclination == 12.5) { y2 = 288; } else if (reqInclination == 13) { y2 = 272; } else if (reqInclination == 13.5) { y2 = 264; } else if (reqInclination == 14) { y2 = 256; } else if (reqInclination == 14.5) { y2 = 248; } else if (reqInclination == 15) { y2 = 240; } return y2; }

private int c1750_2020_kph_speed_function(double reqSpeed) {
    int y1BaseSpeed = 592; // Slider at 1kmh
    int y2 = 0;

    // Returns slider position of required speed in pixels.
    if (reqSpeed <= 11) {
        // If speed is 11kmh or less
        y2 = reqSpeed + (16-(16 * y1BaseSpeed));
    } else if (reqSpeed > 11 && reqSpeed < 12) {
        // If speed is more than 11kmh or less than 12kmh
        y2 = reqSpeed + (8-(16 * y1BaseSpeed));
    } else if (reqSpeed >= 12) {
        // If speed is 12kmh or more
        y2 = reqSpeed + (0-(16 * y1BaseSpeed));
    }

    return y2;
}

— Reply to this email directly, view it on GitHub https://github.com/cagnulein/QZCompanionNordictrackTreadmill/issues/81#issuecomment-1954538261, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAALYWB672EYZYUEMFSITS3YUTCOZAVCNFSM6AAAAABCXBEEZ2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNJUGUZTQMRWGE . You are receiving this because you commented.Message ID: @.*** com>

jhholen commented 6 months ago

Thanks! Tried it now, and it is way off. Same issue as before, where incline works the first few tests. Then I goes incremental from 1.5, 2, 3, 5 and off the chart.

Speed never works at all. Is it possible to see logs on what the values was at each test?

cagnulein commented 6 months ago

sure qz companion is logging on adb logcat

your function was only for y2 , i use the same maps for y1. is it right?

Roberto Viola Software engineer and open source enthusiast http://robertoviola.cloud

Il giorno mer 21 feb 2024 alle 20:36 Jarl-Håvard Holen < @.***> ha scritto:

Thanks! Tried it now, and it is way off. Same issue as before, where incline works the first few tests. Then I goes incremental from 1.5, 2, 3, 5 and off the chart.

Speed never works at all. Is it possible to see logs on what the values was at each test?

— Reply to this email directly, view it on GitHub https://github.com/cagnulein/QZCompanionNordictrackTreadmill/issues/81#issuecomment-1957766101, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAALYWHZO7EAVEGBMFCDAW3YUZEC5AVCNFSM6AAAAABCXBEEZ2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNJXG43DMMJQGE . You are receiving this because you commented.Message ID: @.*** com>

jhholen commented 6 months ago

I really dont get how this works.

I now testet this command twice: adb shell input swipe 75 528 75 486 200

Starting from 0, first time it goes to 2 and if I trigger it again at that position it goes to 4?

cagnulein commented 6 months ago

Probably ifit reacts to a slide to any position .

they are just x1 y1 x2 y2 coordinates

that's why i asked to create a complete formula because i can't test with your very specific tablet

Roberto Viola Software engineer and open source enthusiast http://robertoviola.cloud

Il giorno gio 22 feb 2024 alle 17:39 Jarl-Håvard Holen < @.***> ha scritto:

I really dont get how this works.

I now testet this command twice: adb shell input swipe 75 528 75 486 200

Starting from 0, first time it goes to 2 and if I trigger it again at that position it goes to 4?

— Reply to this email directly, view it on GitHub https://github.com/cagnulein/QZCompanionNordictrackTreadmill/issues/81#issuecomment-1959834200, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAALYWAEYD4W6BURPCJKKGDYU5YCXAVCNFSM6AAAAABCXBEEZ2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNJZHAZTIMRQGA . You are receiving this because you commented.Message ID: @.*** com>

stale[bot] commented 6 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

cagnulein commented 5 months ago

@jhholen any news?