Skip to content

Commit

Permalink
fix: documenter
Browse files Browse the repository at this point in the history
  • Loading branch information
HlisTilen committed Apr 10, 2024
1 parent 13b9a74 commit 051ad64
Show file tree
Hide file tree
Showing 2 changed files with 101 additions and 2 deletions.
3 changes: 3 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
EzXML = "8f5d6c58-4d21-5cfd-889c-e3ad7ee6a615"

[extras]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
100 changes: 98 additions & 2 deletions docs/src/index.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,99 @@
# TCXreader.jl

Documentation for TCXreader.jl
# TCXreader.jl Documentation

## Introduction

TCXreader is a Julia package designed for parsing and analyzing Training Center XML (TCX) files. These files are commonly used by sports and fitness devices (like Garmin) to store workout data, including tracks, laps, and physiological metrics.

## Installation

```julia
using Pkg
Pkg.add("TCXreader")
```

## Usage

To use TCXreader, you first need to load the package and then call the `loadTCXFile` function with the path to your TCX file.

```julia
using TCXreader

author, activities = loadTCXFile("path/to/your/file.tcx")
```

## API Reference

### `TCXTrackPoint`

- **Description**: Represents a single track point in a TCX file, encapsulating geographical, temporal, and physiological data.
- **Fields**:
- `time`: The timestamp of the track point.
- `latitude`: Latitude coordinate (optional).
- `longitude`: Longitude coordinate (optional).
- `altitude_meters`: Altitude in meters (optional).
- `distance_meters`: Cumulative distance in meters (optional).
- `heart_rate_bpm`: Heart rate in BPM (optional).
- `speed`: Speed in m/s (optional).

### `TCXLap`

- **Description**: Represents a single lap within a TCX file, encapsulating temporal, physiological, and spatial metrics.
- **Fields**:
- `startTime`: Lap's start time.
- `totalTimeSeconds`: Total time in seconds.
- `distanceMeters`: Distance in meters.
- `maximumSpeed`: Maximum speed (optional).
- `calories`: Calories burned.
- `averageHeartRateBpm`: Average heart rate (optional).
- `maximumHeartRateBpm`: Maximum heart rate (optional).
- `intensity`: Lap intensity.
- `cadence`: Cadence (optional).
- `trackPoints`: Vector of `TCXTrackPoint`.
- `triggerMethod`: Trigger method for the lap.
- `avgSpeed`: Average speed (optional).

### `TCXActivity`

- **Description**: Represents a single activity within a TCX file, including the sport type, activity ID, laps, and device information.
- **Fields**:
- `sport`: Sport type.
- `id`: Activity identifier, typically a timestamp.
- `laps`: Vector of `TCXLap`.
- `device`: Device information (`DeviceInfo`).

### `DeviceInfo`

- **Description**: Represents the device that recorded the TCX activity, including details such as the name, unit ID, product ID, and version.
- **Fields**:
- `name`: Device name.
- `unitId`: Unit ID.
- `productId`: Product ID.
- `version`: Device software version.

### `TCXAuthor`

- **Description**: Represents the author of the TCX file, including the name, software build version, language ID, and part number.
- **Fields**:
- `name`: Author name.
- `build`: Software build version (`BuildVersion`).
- `langID`: Language ID.
- `partNumber`: Part number.

### Exporting Data

You can also export the loaded TCX data into a CSV file using the `exportCSV` function.

```julia
exportCSV(author, activities, "output_path.csv")
```

For more detailed examples and additional functionality, please refer to the [GitHub repository](https://github.com/firefly-cpp/TCXreader.jl).

## Contributing

Contributions are welcome! Please open an issue or pull request on GitHub if you have suggestions or improvements.

## License

This package is distributed under the MIT License. This license can be found online at <http://www.opensource.org/licenses/MIT>.

0 comments on commit 051ad64

Please sign in to comment.