Skip to content

Commit

Permalink
Make autolaps work correctly. Fixes #36
Browse files Browse the repository at this point in the history
  • Loading branch information
svenstorp committed Sep 8, 2014
1 parent 5b82b61 commit 16208c0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/openambit/logstore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ typedef struct sample_lap_event_type_s {
} sample_lap_event_type_t;

static sample_lap_event_type_t sampleLapEventTypeNames[] = {
{ 0x00, "Autolap" },
{ 0x01, "Manual" },
{ 0x14, "High Interval" },
{ 0x15, "Low Interval" },
Expand Down
8 changes: 8 additions & 0 deletions src/openambit/movescount/movescountjson.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,14 @@ int MovesCountJSON::generateLogData(LogEntry *logEntry, QByteArray &output)
}
case ambit_log_sample_type_lapinfo:
switch (sample->u.lapinfo.event_type) {
case 0x00: /* autolap = 5 */
{
QVariantMap tmpMap;
tmpMap.insert("LocalTime", dateTimeString(localBaseTime.addMSecs(sample->time)));
tmpMap.insert("Type", 5);
marksContent.append(tmpMap);
break;
}
case 0x01: /* manual = 0 */
case 0x16: /* interval = 0 */
{
Expand Down
1 change: 1 addition & 0 deletions src/openambit/movescount/movescountxml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ static typename_lookup_entry_t sampleAltitudeSourceNames[] = {
};

static typename_lookup_entry_t sampleLapEventTypeNames[] = {
{ 0x00, "Distance" },
{ 0x01, "Manual" },
{ 0x14, "High Interval" },
{ 0x15, "Low Interval" },
Expand Down

1 comment on commit 16208c0

@risbac
Copy link

@risbac risbac commented on 16208c0 Sep 9, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can I like a commit? Can't wait to try this fix ! Thank you so much !

Please sign in to comment.