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

Kettler serial connection fixes #2191

Closed
wants to merge 100 commits into from

Conversation

joekearney
Copy link
Contributor

@joekearney joekearney commented Nov 19, 2016

This provides some small fixes for using a Kettler serial device as discussed in this mail thread. It's tested against a Kettler Racer 9.

The commands sent are now upper-cased, and are ST for status and ID to get the ID of the bike. CD returns ERROR from the bike, cd returns nothing.

cc @erikboto

joekearney and others added 30 commits November 19, 2016 11:47
The docs do not reflect the regex for some devices with a prefix of `cu.`. This commit changes the doc and not the regex
Get-status is `ST` not `st`, and get-id is `ID` not `cd`.
.. remove all custom widgets and prepare for next commit that
   replaces use of QTKit with AV Foundation on MacOS
.. on hdpi the fonts get squished by spacing
.. fixup build id and version strings for Sierra build.
.. that removed VideoWindow for non-Mac.
Adding support for Garmin Edge 820 (unit type 2530)
.. we no longer build with QT4, so deprecate it in Travis

.. there are still some users that build with QT4 on Linux/OpenBSD
   but we no longer seek to support this configuration officially
Fixed SML lap swimming files import when using drill mode
adding space to Fenix 2 & Fenix 3 devices (all other devices are name-space-model)
Cosmetic - adding/maintaining consistency
One record per length with the same conventions
used for FIT files
Added swim XData for SML lap swimming files
Initial translation contributed by Henrik Johansson,
recognition added to contributors list.
Fixes GoldenCheetah#2201
.. #ifdef should have been removed when the Mac specific
   UI elements in MainWindow were removed.
Fixed metric formatting in Compare Pane
.. they were removed from code recently but still
   lingered harmlessly in the codebase.

.. now moving into the deprecated folder to stop
   them from being used again in the future.
.. from December 7th 2016 read access (for downloading
   from TrainingPeaks) has been revoked, even for paid
   up members.

.. write access (upload) is not revoked.

.. This is essentially anti-competitive behaviour and
   returns TrainingPeaks and their products, once again
   to that of a 'closed' product.

.. We will no longer support their service since we
   cannot and will not promote such behaviours now
   or ever.

.. We are now considering the best way to purge all
   other references to their trademarks and remove
   any indication that their products are endorsed.
Qwkcode is limited to integer values of seconds. When a workout is specified in qwkcode then saved to an ERG file, the interval durations are rounded from integer seconds to fractional minutes with 2 decimal places of precision. When the ERG file is read, it is translated to a WWPoint object that stores time as double seconds. To accurately calculate the duration of a time interval defined by two WWPoints we should round the individual points first then take the integer difference. The table below demonstrates the consistency of rounding on both ends of the qwkcode -> ERG -> qwkcode round trip.

| qwkcode (original) | ERG time (rounded from qwkcode) | WWPoint time (precisely calculated from ERG time) | qwkcode (rounded from WWPoint) |
|--------------------|---------------------------------|---------------------------------------------------|--------------------------------|
|                  1 |                            0.02 |                                               1.2 |                              1 |
|                  2 |                            0.03 |                                               1.8 |                              2 |
|                  3 |                            0.05 |                                                 3 |                              3 |

(3 seconds is the smallest unit that fits evenly into a base ten fractional minute, so this pattern will repeat without loss of precision.)
There are two paths to displaying the power/time overlay on a workout block:
* Hover over the block
* Select the qwkcode line corresponding to the block

Both of these paths had their own uniquely flawed method of calculating the block duration to display. The first path stored the previous time point as a truncated integer number of seconds, then subtracted it from the current, double precision time point. This resulted in occasional over-reported durations. The second path took the double precision difference between the current and previous time points, then truncated that difference for display. This resulted in occasional under-reported durations.

Both of these paths now consistently report the same value. The value shown will take the format ss.s for times less than 60s, or hh:mm:ss for times 60s or more.
dresco and others added 24 commits December 26, 2016 10:20
Use a monotonic timer for ANT sensor calculations, instead
of the wall clock time.
Due to poor quality data from Tacx simulated S&C channels, we
ignore any Speed & Cadence data from the same device_id as a
Tacx FE-C device.

The speed and cadence data is also provided over the FE-C channel,
so not losing anything except bad data.

Note that it can take ~33s to receive a manufacturer id
message and take effect.
... create Caching Root Directory if not yet existing
.. if the "Download" text is translated then the code that checks
   if we're uploading or downloading doesn't translate the text
   leading to it continually trying to upload if the language
   selected is not English.
  use GoldenCheetah json (instead of tcx)
.. will be used for banister modelling.

.. can be downloaded from http://apps.jcns.fz-juelich.de/src/lmfit/
	to ignore handshake errors
The docs do not reflect the regex for some devices with a prefix of `cu.`. This commit changes the doc and not the regex
Get-status is `ST` not `st`, and get-id is `ID` not `cd`.
@liversedge
Copy link
Member

this needs rebasing !

@joekearney
Copy link
Contributor Author

Yeah I just broke this... I'm not sure of the best way to remove all of this without a force push. I might just reapply the changes locally to a new up-to-date branch and re-submit the PR

@joekearney
Copy link
Contributor Author

Closing in favour of new PR #2276

@joekearney joekearney closed this Jan 1, 2017
@joekearney joekearney deleted the kettler-serial-fixes branch January 1, 2017 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants