Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added tests for bike power functions #2174

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
678facc
#2174 Added tests for bike power functions
drmason789 Mar 1, 2024
15d2753
#2174 restrict the samples when exploring the boundaries of the power…
drmason789 Mar 1, 2024
bf4bf1e
Merge remote-tracking branch 'remotes/origin/master' into bike_power_…
drmason789 Mar 7, 2024
c74fe53
#2174 moved erg test functionality into the new Erg folder from other PR
drmason789 Mar 7, 2024
6fc5022
Merge remote-tracking branch 'remotes/origin/master' into bike_power_…
drmason789 Mar 19, 2024
d9c9f29
Merge remote-tracking branch 'remotes/origin/master' into bike_power_…
drmason789 Mar 25, 2024
e335ac2
#2174 added minmax type and introduced minimum and maximum resistance…
drmason789 Mar 25, 2024
2ab31e8
#2174 avoid template in cpp
drmason789 Mar 26, 2024
6d76f98
#2174 added bike cadence limits.
drmason789 Mar 26, 2024
26d2aac
#2174
drmason789 Mar 26, 2024
439570b
#2174
drmason789 Mar 27, 2024
d2be67c
#2174 removed typo
drmason789 Mar 27, 2024
ce54799
#2174 consistent interface for bike::wattsFromResistance
drmason789 Mar 27, 2024
6e018a1
#2174 added tests for conversion to and from resistance and Peloton r…
drmason789 Mar 27, 2024
55cb801
#2174 increase use of minmax<T> in test code. Some work to make Pelot…
drmason789 Mar 29, 2024
30dfa77
Merge branch 'cagnulein:master' into bike_power_tests
drmason789 Mar 29, 2024
a561444
Merge branch 'cagnulein:master' into bike_power_tests
drmason789 Apr 2, 2024
2ca3644
#2174 replaced powerFromResistanceRequest with wattsFromResistance
drmason789 Apr 2, 2024
da9ebd8
Merge branch 'bike_power_tests' of https://github.com/drmason789/qdom…
drmason789 Apr 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
#2174 avoid template in cpp
  • Loading branch information
drmason789 committed Mar 26, 2024
commit 2ab31e8bad196b4855ae5dd39041f861704dd8ef
23 changes: 0 additions & 23 deletions src/minmax.cpp

This file was deleted.

17 changes: 12 additions & 5 deletions src/minmax.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,21 @@ struct minmax {
private:
T _max, _min;
public:
const T max();
const T min();
const T max() { return _max; }
const T min() { return _min; }

explicit minmax(const T min, const T max);
explicit minmax(const T min, const T max) : _max(max), _min(min) {}

T clip(const T value) const;
T clip(const T value) const {
T result = value;
if(value<_min) result=_min;
else if(value>_max) result=_max;
return result;
}

bool contains(const T value) const;
bool contains(const T value) const {
return value>=_min && value<=_max;
}
};

#endif
1 change: 0 additions & 1 deletion src/qdomyos-zwift.pri
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ DEFINES += QT_DEPRECATED_WARNINGS IO_UNDER_QT SMTP_BUILD NOMINMAX
SOURCES += \
$$PWD/devices/focustreadmill/focustreadmill.cpp \
$$PWD/devices/trxappgateusbelliptical/trxappgateusbelliptical.cpp \
$$PWD/minmax.cpp \
QTelnet.cpp \
devices/bkoolbike/bkoolbike.cpp \
devices/csaferower/csafe.cpp \
Expand Down
Loading