Commit Graph

1120 Commits

Author SHA1 Message Date
Mark Liversedge
524ab81a08 Fix FitRideFile for header change
The header size in FitRideFile has increased from
12 to 14 bytes, but the new field is at the end of
the header, not in the middle.

Additionally, there is a new global record (79) which
we now silently ignore.
2011-08-27 23:52:56 +01:00
Mark Liversedge
ad9a76a172 Support FR310xt latest firmware
Fit file format can now have a 12 and 14 byte header. This
patch adds support for 14 byte headers since this is required
by the latest 310xt firmware.

Fixes #430.
2011-08-27 09:07:45 +01:00
Damien
5b838d99c2 Correct bug in the peakPowerHr formula 2011-08-23 23:24:18 -04:00
Damien
b7bfb98dc8 Aerolab : Change LCD display to LineEdit
Also fixes v3 crash when changing CdA.

Fixes #423.
2011-08-23 22:18:24 +01:00
Mark Liversedge
7352245a91 Fix Macro device data crash
If you attempt to download from a Macro device
and use wrong device or initial read fails then
it crashes, this patch fixes that.

It does not fix more general data errors but should
at least mean incorrect user selections do not result
in GC crashing.

Fixes #366.
2011-08-21 21:16:41 +01:00
Mark Liversedge
bfa68faeda Update .gitignore for Lex/yacc
Ignore temporary files generated when lex
and yacc generate parsers from a grammar.
2011-08-21 16:51:18 +01:00
Mark Liversedge
95d6a40ecd Fix date/time handling when importing rides
The ride import wizard would only allow the user to
change the ride date/time if it was a .gc .json or
.csv file. This was (wrongly) because we could not
update the date/time defined within the ride file itself
(we cannot write in other formats e.g. wko).

Of course, we encode the ride date/time in the filename
and so it could be changed. However, not all the RideFile
readers supported this.

To get around this, the import wizard now does let you
change the date and time for any file type and the ride
file factory method openRideFile() will override whatever
date and time is returned by examining the filename. The
user needs to double click the date or time to edit it.

Additionally, the select date... combo would only register
when you changed the selection, it now defaults back to
the 'select date..' option after each selection.

Lastly, the 'choose date' function now works as advertised
and triggers editing the date for the ride selected.

[commit cd86521 cherry picked into master from release_3.0.0dev]

Fixes #11
2011-08-21 15:43:06 +01:00
Mark Liversedge
3a4b782a16 Merge branch 'master' of github.com:/srhea/GoldenCheetah 2011-08-21 15:17:45 +01:00
Mark Liversedge
7331775e40 Add JSON support to v2.1
Patch to allow v2.1 to read v3.1 .json ridefiles.

Version 3 introduces a new GC file format
using Javascript object notation (json). In
version 3 files are written in this format
as a local, native format thus deprecating the
XML .gc notation.

This backport to 2.1 does not;
* write in json format, it just reads files
* set RideFile::rideId, since it is not present in v2

To build you will need lex/yacc (or flex/bison) the
instructions are within gcconfig.pri.in but are the
same as for version 3.

Fixes #395.
2011-08-21 15:12:01 +01:00
Damien
0c7abe9755 Modify Aerolab to add interval highlight and zoom + auto offset
Fixes #241
Fixes #147
2011-08-17 13:50:08 -04:00
Mark Liversedge
9ab5fb26e2 Guess ride date time for Poweragent CSV files
File name is in the format "name yyyy-mm-dd hh-mm-ss.csv".

[cherry picked into master from c08dae in release_3.0.0dev]

Fixes #281.
2011-08-07 22:53:30 +01:00
Mark Liversedge
a641ec7e0a Fit files sometimes go backwards
FIT record type '253' occasionally causes time to go
backwards, this might be a decoding error, but for now
we force time to go forward anyway.

Looking at bad files GPS data with this patch suggests
this is the correct behaviour.

Fixes #104.
2011-08-06 17:58:12 +01:00
Damien
c513a47e07 Modify TRIMP formula to use time_riding instead of workout time
Fixes #355.
2011-08-06 12:08:44 +01:00
Mark Liversedge
a562d2f73b Fix LogY Intervals on Histogram
The LogY function for histograms was overlooked
when implementing intervals. The baseline and
start/end values of the interval curve needed to
be set to non-zero values to match the main curve.

Fixes #396.
2011-08-06 11:48:18 +01:00
Damien
dfbb1c29f8 Correct interval 2011-08-05 22:40:05 +01:00
Damien
b0cca3c2fa Modification to handle odd start page and compatible with qt 4.6 2011-08-05 17:01:16 +01:00
Damien
8c2eac427b Add a setFocus on the Treelist to correct a MacOs Bug of Qt
Fixes #255.
2011-08-05 15:14:38 +01:00
Mark Liversedge
880c97c639 Don't allow Nan or Inf sample values
I thought this was introduced previously and was not. When
appendPoint adds a new sample it now sets non-finite values
to zero.
2011-08-05 15:03:34 +01:00
Mark Liversedge
614f267a5e Merge branch 'master' of github.com:/srhea/GoldenCheetah 2011-08-05 14:54:37 +01:00
Mark Liversedge
14f7924c28 Fix SummaryWindow crash
When a large number of intervals are defined (>50 or so)
then the RideSummary window crashes.

It appears to be a bug in QTextEdit. It does a double free
when setHtml is called, after a 'large' text item was
set. It may be a QString bug.

To avoid the issue we use a QWebView instead of a QTextEdit
to display the summary and then try and set fonts to match
the application.

[cherry-picked and merged from release_3.0.0dev]
2011-08-05 14:53:58 +01:00
Gareth Coco
7a501a9699 Make interval period on map user defineable
Previously the map track was broken up into 30 second intervals.
This patch allows the user to define a time interval they want.

Fixes #273
2011-08-04 23:30:36 -04:00
Mark Liversedge
f1238fcce6 Fix Save when old .bak exists
If you save a ride and then delete it. The re-import and save
you will end up with two copies of the ride in the ride list.

This is because when we save the first time the original file
is renamed to e.g. ride.tcx.bak and the new ride.json is then
created. All is well.

But then delete the ride and it will rename ride.json to
ride.json.bak. Again, All is well.

Now, re-import the ride. We now have; ride.tcx.bak and
ride.json.bak and ride.tcx. Again, all is well.

But now, if you make changes and save it will attempt to
rename ride.tcx to ride.tcx.bak AND FAIL. This is because
the old ride.tcx.bak file is there. It will then create
ride.json. All is NOT well, since we have two rides with
the same date and time but different extensions.

This patch fixes this by unlinking ride.ext.bak before
trying to rename the file.

[folded in manually from commit #1d135a in branch release_3.0.0dev]
2011-08-03 20:19:19 +01:00
Mark Liversedge
4784408106 Fix annoying gap in CP curve. 2011-08-03 14:25:24 -04:00
Damien
182208c145 Bug #178 TRIMP is not updated after modification in Rest Hr Tag -> compute metric after save
Fixes #178
2011-08-03 13:59:51 -04:00
Mark Liversedge
00959bed8c Better support for Negative, Inf, NaN and High Values
Some ride file formats use -1 to indicate sensor not
present or data loss (e.g. TPX) and on occasion a NaN
or Infinite value will be presented.

This patch handles this by converting negative data sample
values to zero and handling out of bounds values when
selecting zone ranges.

This is not a substitute for better handling of poor ride
data but it reduces the effect.

Also fixes #311.
2011-08-03 13:40:20 -04:00
Mark Liversedge
57c7260a19 Fix .man crash in CP plot
Old .man files contain insufficient data to
compute a CP curve and caused an array bound
crash.

Fixes #205.
2011-08-02 02:14:57 +01:00
Mark Liversedge
a70cf8ebc0 Fix RideEditor find dialog for 'between'
The find dialog expected the between values
to be small and high, this patch will find
values between regardless of whether the
search values are lo/hi or hi/lo.

Fixes #351.
2011-08-01 23:52:36 +01:00
Frank Zschockelt
0f9b82a750 Included 4 sample sigma files in the test/rides directory 2011-08-01 23:41:30 +01:00
Frank Zschockelt
8cca3c088a Support for Sigma SLF/SMF file formats
A ridefile reader for Sigma .slf/.smf format files.

Fixes #90.
2011-08-01 23:39:54 +01:00
Mark Liversedge
d84ffec0a6 Fix RideSummaryWindow crash
The recent patch to allow users to configure which
metrics to display on the ride summary window is not
forwards compatible. If metrics referenced no longer
exist (i.e. they are from a future release or have
been deprecated) GC will crash.
2011-08-01 23:36:49 +01:00
Damien
20477e1670 Altitude scale present with no altitude data.
Uncheck the channel if not present. Fixes #295.
2011-08-01 22:17:20 +01:00
Mark Liversedge
610b2ea2d0 Remove console error for seasons.xml
There is no need to warn about seasons.xml missing, it
is quite acceptable to have none set. Worse still sending
to the console log is next to useless for users that
don't launch from the command line.

Partial cherry pick from 4972f2472e (v3.0.0dev)
2011-08-01 13:22:23 -04:00
Mark Liversedge
e7a7803f09 Fix WKO+ file reader GPS 'drops'
The WKO+ file format appears to record drops in
recording of GPS data with a latlon of 180,180. We
expect this to be 0,0.

This makes the WKO+ file reader consistent with the
GoogleMapControl and removes the need to clean data
there.

If it is found that 180,180 is the standard way of
recording drops in GPS signal then we can change the
code. We use 0,0 since it is conveniently at sea off
the west coast of Africa.

Cherry pick d06c9e97c9 (From v3.0.0dev)
2011-08-01 13:14:31 -04:00
Damien
c6a376b89f Add PeakPowerHr metric (average HR during peak power) 2011-07-28 21:12:20 +01:00
Damien
65c4d89890 Correct crash with truncated files
Fixes #337
Fixes #354
2011-07-28 12:41:55 -04:00
Rainer Clasen
1674558dbb FitRideFile: turned assertions into graceful fail
reading Fit files with Smart recording and a certain pattern of timestamps
could cause assertions. This shouldn't happen, as it's no Programming error.

Changed the checks into graceful failures.

Unfortunatly I don't have any files to test this.

fixes #364
2011-07-25 14:07:14 -04:00
Rainer Clasen
ee79a86c1f SrmRideFile: turned assertions into graceful fail
reading unsupported SRM files caused assertions. This shouldn't happen, as
it's no Programming error.

Changed the checks into graceful failures.

fixes #364
2011-07-25 14:07:07 -04:00
Mark Liversedge
92897a966b Better rounding of time in AllPlot
With realtime data there will often be samples with
timestamps like 940.002 and 940.998. This cuases an
issue on the ride plot, where it believes there is
no sample for 941 and therefore plots a zero value.

This patch rounds the timestamps to the nearest 100th
of a second, which is consistent with the mechanism
used in the ride editor.
2011-07-24 21:36:21 -04:00
Damien Grauser
ca1c4def3a O_Sync Macro X device support
Adds support for the Macro X bike computer for downloading rides
and reading/writing in the native file format (sync).

For more information on this new bike computer see:
http://www.o-synce.com/en/products/bike/macro-series/macrohigh-x.html

Fixes #357.
2011-07-24 10:44:46 +01:00
Damien
05346eda24 Add summary metrics list to preferences
Fixes #317.
2011-07-23 17:41:37 +01:00
Rainer Clasen
bea79092ab Fit: handle unknown fields gracefully
So far the FIT parser bailed out, whenever it found something
unknown/uninterested to GC. This is quite orthogonal to the FIT design, as
it's supposed to be extended.

renamed read_<foo> functions to match the FIT base_type names.

unified handling of "unavailable/invalid" values - i.e. if sensor data is
temporary unavailable. This allows easier and consistent handling -
especially for the uintXz base_types, which only differ by a different
"invalid" value. Had to change the type of the "values" list to int64 to
fit uint32/int32, as well.

added proper support for signed integer types. I'm wondering, why lon, lat
+ temperature were decoded properly...

added support for currently unsupported base types by just skipping their
bytes. This allows us to continue reading.
2011-07-23 13:57:49 +01:00
Rainer Clasen
e478c24650 Fit: support big/little endian data
... on both, big and little endian machines.

Fit reader only supported little endian data on little endian machines.

All values read from FIT files are now swapped (if neccessary) according
to file and system endianess.

fixes #287
2011-07-23 13:57:49 +01:00
Rainer Clasen
96bb21d04d Fit: ignore unknown message types
do not bail out on unknown message types. This violates the design of the
Fit format of being extensible.

As this was the last thing using the global_msg_names QMap, I've nuked
this, aswell.
2011-07-23 13:57:49 +01:00
Alejandro Martinez
65615295c2 Add HrZones to Weekly Summary and Fix Spanish Translation
Fixes 344.
2011-07-23 12:09:18 +01:00
Rainer Clasen
b21d24039c fix reading signed values from srm files
seems, the assumption for "speed" in SRM7 files being unsigned was wrong.
Powercontrol/SRMWIN seem to use negative speed as "invalid".

Furthermore altitude may become negative, as well.

To address this, QDataStream now does the bit-swapping and speed +
altitude are read as signed values.

Fixes 346.
2011-07-23 12:08:56 +01:00
Rainer Clasen
c25f920062 whitespace cleanup
unfortunatly my latest patches introduced some tabs. Replaced them with
spaces to meet GC indent style.

Fixes 347.
2011-07-23 12:08:56 +01:00
Alejandro Martinez
7f2b6dd793 Set UTF-8 in charts,metadata and seasons xml files
Fixes 345
2011-07-23 12:08:56 +01:00
Damien
148390ea61 handle showHr/Speed/Cad/Alt state for stacked view
Fixes 130.
2011-07-23 12:08:56 +01:00
Gareth Coco
c525a36ea5 Change start date from UTC to localtime for bin ride file
Fixes 338.
2011-07-23 12:08:56 +01:00
Damien Grauser
627595175f Update French translation. 2011-06-07 22:31:47 +01:00