Documentation
¶
Index ¶
- func CvtToFitLaps(db *TCXDB) (runLaps []fit.Lap)
- func CvtToFitRecs(db *TCXDB) (runRecs []fit.Record)
- func DeviceInfo(db *TCXDB) (DevName string, DevUnitId string, DevProdID string)
- func Distance(lat1, lon1, lat2, lon2 float64) float64
- type Activities
- type Activity
- type Author
- type Build
- type BuildVersion
- type Device
- type Lap
- type TCXDB
- type Track
- type Trackpoint
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CvtToFitLaps ¶
Convert the TCXDB structure created from the XML to fit.Laps structure
func CvtToFitRecs ¶
Convert the TCXDB structure created from the XML to fit.Record structure
func DeviceInfo ¶
Convert the TCXDB structure to device information.
func Distance ¶
Distance function returns the distance (in meters) between two points of a given longitude and latitude relatively accurately (using a spherical approximation of the Earth) through the Haversin Distance Formula for great arc distance on a sphere with accuracy for small distances
point coordinates are supplied in degrees and converted into rad. in the func
distance returned is METERS!!!!!! http://en.wikipedia.org/wiki/Haversine_formula
Types ¶
type Activities ¶
type Activities struct {
Act []Activity `xml:"Activity"`
}
func ReadActivities ¶
func ReadActivities(path string) (acts *Activities, err error)
Read the the activities.
type Activity ¶
type Author ¶
type Build ¶
type Build struct {
Version BuildVersion `xml:"Version,omitempty"`
Type string `xml:",omitempty"`
Time string `xml:",omitempty"`
Builder string `xml:",omitempty"`
}
type BuildVersion ¶
type Device ¶
type Device struct {
Name string `xml:",omitempty"`
UnitId uint `xml:",omitempty"`
ProductID string `xml:",omitempty"`
Version BuildVersion `xml:",omitempty"`
}
type Lap ¶
type Lap struct {
Start string `xml:"StartTime,attr"`
TotalTime float64 `xml:"TotalTimeSeconds,omitempty"`
Dist float64 `xml:"DistanceMeters,omitempty"`
Calories float64 `xml:",omitempty"`
MaxSpeed float64 `xml:"MaximumSpeed,omitempty"`
AvgHr float64 `xml:"AverageHeartRateBpm>Value,omitempty"`
MaxHr float64 `xml:"MaximumHeartRateBpm>Value,omitempty"`
Intensity string `xml:",omitempty"`
TriggerMethod string `xml:",omitempty"`
Trk *Track `xml:"Track"`
}
type TCXDB ¶
type TCXDB struct {
XMLName xml.Name `xml:"TrainingCenterDatabase"`
Acts *Activities `xml:"Activities"`
Auth Author `xml:"Author"`
}
type Track ¶
type Track struct {
Pt []Trackpoint `xml:"Trackpoint"`
}
type Trackpoint ¶
type Trackpoint struct {
Time time.Time
Lat float64 `xml:"Position>LatitudeDegrees"`
Long float64 `xml:"Position>LongitudeDegrees"`
Alt float64 `xml:"AltitudeMeters,omitempty"`
Dist float64 `xml:"DistanceMeters,omitempty"`
HR float64 `xml:"HeartRateBpm>Value,omitempty"`
Cad float64 `xml:"Cadence,omitempty"`
Speed float64 `xml:"Extensions>TPX>Speed,omitempty"`
Power float64 `xml:"Extensions>TPX>Watts,omitempty"`
}