Steve Gribble ac2a2d4f82 fix bugs and add features to Computrainer3dpFile
Specifically:

1.  The previous code assumed the wrong units while extracting
    speed and distance from a .3dp file.  Computrainer stores
    speed in (miles per hour / 160), and distance in kilometers.
    This patch converts .3dp speed/distance data points into
    kph and km correctly.  As a side-effect, speed and distance
    are displayed correctly in GC windows and calculations.

2.  This patch adds code to extract altitude data from a .3dp
    file and include it in a ride.

3.  .3dp files do not have a consistent inter-datapoint time
    interval.  Since GC expects one, the earlier version of this
    code averaged 1000 data points from the middle of the ride to
    estimate this interval.  Unfortunately, this approach caused
    a bunch of problems for various calculations that GC does,
    such as calculating the riding time (vs. workout time),
    average speed, xPower, critical power plot and FTP, and so
    on.  [GC assumes that # data points * inter-datapoint-interval
    = workout time, but this isn't true when you used an estimated
    interval.]

    To fix this, this patch adds averaging and interpolation code
    to covert the data point sequence in the .3dp file to an
    averaged sequence with a data point every 250ms.  Since the
    inter-data-point interval is now fixed, these calculation bugs
    went away, and correct values are now calculated and displayed
    by GC.

4.  Fix (3.) has another useful side-effect:  the number of data
    points per ride given to GC goes down by 10x.  (Raw .3dp files
    have a data point every 30-50ms.  This averaging/smoothing
    code emits a data point every 250ms.)  Since the critical
    power calculation is an O(n^2) calculation, the time for
    this calculation is reduced by 100x.  Instead of an hour
    to do the calculation for a typical 2hr ride, it now takes
    less than a minute.

5.  The code was cleaned up in several regards:  comments
    were added to help document the .3dp format and explain
    the averaging/smoothing code, and types from boost/cstdint.hpp
    were used instead of native C types when using a variable
    of a specific size  (e.g., the code now uses uint16_t instead
    of unsigned short, etc.).

This patch was built by Steve Gribble and Daniel Stark.
2009-12-03 20:25:33 -08:00
2009-11-28 18:50:47 -05:00
2009-10-03 17:57:22 -04:00
2009-09-20 11:13:11 -07:00
2009-09-20 11:13:11 -07:00
2006-09-06 23:59:42 +00:00

To build

  cp src/gcconfig.pri.in src/gcconfig.pri
  cp qwt/qwtconfig.pri.in qwt/qwtconfig.pri

Edit both src/gcconfig.pri and qwt/qwtconfig.pri as necessary, then

  qmake
  make

To uninstall the older FTDI VCP drivers on Mac OS X, open a Terminal and type:

  sudo mv /System/Library/Extensions/FTDIUSBSerialDriver.kext /tmp

Type your password when prompted, then restart your computer.
Languages
Standard ML 68.3%
C++ 28.1%
C 2.7%
Yacc 0.2%
QMake 0.2%
Other 0.1%