~ubuntu-branches/ubuntu/saucy/goldencheetah/saucy

« back to all changes in this revision

Viewing changes to src/Computrainer3dpFile.cpp

  • Committer: Package Import Robot
  • Author(s): KURASHIKI Satoru
  • Date: 2013-08-18 07:02:45 UTC
  • mfrom: (4.1.8 sid)
  • Revision ID: package-import@ubuntu.com-20130818070245-zgdvb47e1k3mtgil
Tags: 3.0-3
debian/control: remove needless dependency. (Closes: #719571)

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
 
34
34
#include <algorithm>            // for std::sort
35
35
#include <assert.h>
36
 
#include <boost/cstdint.hpp>    // for int8_t, int16_t, etc.
 
36
#include <stdint.h>    // for int8_t, int16_t, etc.
37
37
#include <iostream>
38
38
 
39
39
#include "math.h"
48
48
                                               ());
49
49
 
50
50
RideFile *Computrainer3dpFileReader::openRideFile(QFile & file,
51
 
                                                  QStringList & errors)
 
51
                                                  QStringList & errors,
 
52
                                                  QList<RideFile*>*)
52
53
    const
53
54
{
54
55
    // open up the .3dp file, prepare a little-endian-ordered
76
77
    // the next 4 bytes are the ASCII characters 'perf'
77
78
    char perfStr[5];
78
79
    is.readRawData(perfStr, 4);
79
 
    perfStr[4] = NULL;
 
80
    perfStr[4] = '\0';
80
81
    if(strcmp(perfStr,"perf"))
81
82
    {
82
83
        errors << "File is encrypted.";
237
238
          // special case first data point
238
239
          rideFile->appendPoint((double) ms/1000, (double) cad,
239
240
                                (double) hr, km, speed, 0.0, watts,
240
 
                                altitude, 0, 0, 0.0, 0);
 
241
                                altitude, 0, 0, 0.0, 0.0, RideFile::noTemp, 0.0, 0);
241
242
        }
242
243
        // while loop since an interval in the .3dp file might
243
244
        // span more than one CT_EMIT_MS interval
286
287
                                0, // lon
287
288
                                0, // lat
288
289
                                0.0, // headwind
 
290
                                0.0, // slope
 
291
                                RideFile::noTemp, // temp
 
292
                                0.0,
289
293
                                0);
290
294
 
291
295
          // reset averaging sums
329
333
    rideFile->setRecIntSecs(((double) CT_EMIT_MS) / 1000.0);
330
334
 
331
335
    // tell GC what kind of device a computrainer is
332
 
    rideFile->setDeviceType("Computrainer 3DP");
 
336
    rideFile->setDeviceType("Computrainer");
 
337
    rideFile->setFileFormat("Computrainer 3DP (3dp)");
333
338
 
334
339
    // all done!  close up.
335
340
    file.close();