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

activity: structured activity file type #18

Open
ktye opened this issue Jul 24, 2016 · 1 comment
Open

activity: structured activity file type #18

ktye opened this issue Jul 24, 2016 · 1 comment

Comments

@ktye
Copy link

ktye commented Jul 24, 2016

Currently, after decoding you basically get a flat activity file.
This closly represents the fit file protocol.
But an application might be more interested in a tree-structure of the activity, e.g.

type StructuredActivityFile {
  Sessions []StructuredSession
}
type StructuredSession{
  Lap []*StructuredLap
}
type StructuredLap {
  LapMsg // Copy or reference of original lap for summary information
  Records []*RecordMsg // Contains only data records which were during this lap.
 // maybe also others, such as events, ...
}

This could be calculated in a post-processing step as a method of ActivityFile by

 func (a *ActivityFile) StructuredActivity() StructuredActivity {...}

I guess it's only neccessary to compare timestamps to build the tree.

What do you think of this?
Or is the scope of the package to represent the fit protocol closly, leaving all higher level functionality for other packages?

@tormoder tormoder added this to the Unplanned milestone Jul 30, 2016
@tormoder
Copy link
Owner

Yes, I agree this could be useful, and the method signature looks about right. Maybe it should also be possible to specify if the Activity should be "cloned", or to just keep the references to the original ActivityFile, so that any changes are reflected for both structures.

I would like to have this as a post-processing step. I already have an earlier draft of some other post-processing functionality (determining time zones based for local timestamps based on GPS-coordinates). I will put this in a separate package because it uses an external dependency, and I don´t want the core fitpackage to have any external deps. I don`t think your suggestion needs any external dependencies, so it may be possible to place it in the core package.

@tormoder tormoder modified the milestones: Unplanned, fit release 0.3.0 Apr 3, 2017
@tormoder tormoder changed the title Structured activity file type activity: structured activity file type Apr 3, 2017
@tormoder tormoder modified the milestones: fit release 0.3.0, Unplanned May 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants