cagnulein / qdomyos-zwift

Zwift bridge for smart treadmills and bike/cyclette
https://www.qzfitness.com/
GNU General Public License v3.0
342 stars 104 forks source link

Added tests for bike power functions #2174

Open drmason789 opened 3 months ago

drmason789 commented 3 months ago

To finish this PR, some thought will be needed about what it should test.

I have defined the erginterface abstract class, which acts as an interface for the powerFromResistance and resistanceFromPower functionality offered by the bike class. Currently the bikeergfunctions class implements this for bikes, by setting the bike's current cadence, using the corresponding function to get the resistance or power, then restoring the bike's original cadence.

The interface supports optionally defined (min, max) x (cadence, resistance) representing the domain the bike knows about so the tests adapt to the boundaries provided, where provided.

What is tested?

What is not tested?

drmason789 commented 3 months ago

@cagnulein is this something you want to continue with?

drmason789 commented 3 months ago
cagnulein commented 3 months ago

@drmason789 Actually I was looking to finalize the dynamic erg table for the bike where I don't have a static power table first. Do you agree?

Of course the dynamic power table will be applied only to the bike with automatic resistance and without the static power table.

cagnulein commented 3 months ago

@drmason789 i mean this one https://github.com/cagnulein/qdomyos-zwift/pull/2175 if you want to review my code go on! (I didn't test myself yet)

drmason789 commented 3 months ago

Actually I was looking to finalize the dynamic erg table for the bike where I don't have a static power table first. Do you agree?

Yes.

drmason789 commented 3 months ago

@drmason789 i mean this one https://github.com/cagnulein/qdomyos-zwift/pull/2175 if you want to review my code go on! (I didn't test myself yet)

Definately. I took a quick look and will have some comments about this later.

drmason789 commented 2 months ago

@cagnulein What is the intended difference between the functions wattsFromResistance and powerFromResistanceRequest?

drmason789 commented 2 months ago

@cagnulein Remember the resistance_t change? Would you be agreeable to me adding cadence_t, heartRate_t, power_t, pelotonResistance_t, inclination_t alongside it and propagating throughout the codebase, in a different PR?

cagnulein commented 2 months ago

@cagnulein What is the intended difference between the functions wattsFromResistance and powerFromResistanceRequest?

@drmason789 it was intented to use for renpho bikes but at the end powerFromResistanceRequest is a dead code

cagnulein commented 2 months ago

@cagnulein Remember the resistance_t change? Would you be agreeable to me adding cadence_t, heartRate_t, power_t, pelotonResistance_t, inclination_t alongside it and propagating throughout the codebase, in a different PR?

@drmason789 yes sure!

stale[bot] commented 1 month 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 1 month ago

@drmason789 i added erg tables for all the bikes with the new ergtable module. Maybe it could impact also this

stale[bot] commented 1 month 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.