php-fit-file-analysis
php-fit-file-analysis copied to clipboard
question: chronological access to laps, events and records?
Hi
First, thanks for a truly useful project that is making me attempt an exercise database so much more doable.
Apologies, this is a question rather than an issue. Whilst most applications show lap splits, nothing really allows drilling down into what I term 'legs' i.e. portions of activity between pauses of the timer during a lap. I have a test file where the end of lap 2, the start of lap 3, and one location record all have the same UNIX timestamp and I'm not sure how to calculate which lap this record belongs to. Is it possible for me to iterate through all events (timer pauses), lap markers and location records together in chronological order so as to know which lap to assign a particular record to? Or perhaps access fractions of a second (assuming they exist) for each record?
Hi @drewvelo
The isPaused() method may be of some use to you. Line 2264:
/**
* Returns array of booleans using timestamp as key.
* true == timer paused (e.g. autopause)
*/
public function isPaused()
{
/**
* Event enumerated values of interest
* 0 = timer
*/
$tek = array_keys($this->data_mesgs['event']['event'], 0); // timer event keys
/* ... */
Have you downloaded and used the FitSDK from the ANT+ website? Open up the java sub-directory and drop your FIT file onto the FitToCSV.bat batch file. It'll output a CSV file for you to examine.
Because of the message architecture, Lap messages are discrete to the Record messages.
Looking in the Profile.xlsx that is part of the FitSDK, I note that Lap messages have a start_time and a total_timer_time. The laps shouldn't overlap.
Hope this helps?
Thanks for this. I've had a look through the SDK before and found the spreadsheets useful, but don't think I've quite got the file format straight in my head. I'll have a play with the isPaused function and experiment with the CSV converter, both of which should help further my understanding.
PS: my friend's (presumably UK spec) Garmin Edge 1030 uses the product ID 2713.