Class PolarFile

Description

Common Class for all Polar files (ppd, pdd, hrm)

Contains common code for Polar files parsing

  • todo: Include common code to open / close file

Located in /class/PolarFile.class.php (line 28)


	
			
Direct descendents
Class Description
PolarPpd Class to parse Polar PPD file and insert / update data to database
PolarPdd Class to parse Polar PDD file and insert / update data to database
PolarHrm Class to parse Polar HRM file and insert / update data to database
Variable Summary
string $fileName
integer $userId
string $version
Method Summary
void PolarFile (string $fileName, integer $userId)
string _parse_block_get (string &$buffer, integer &$line_no)
string _parse_note (string $note, string &$exercise_type, integer &$distance, array &$int_training, array &$options)
Variables
string $fileName (line 34)

File name of Polar file (full pathname)

integer $userId (line 40)

User ID (as in database)

string $version (line 46)

Polar file version

Methods
Constructor PolarFile (line 55)

Class constructor

void PolarFile (string $fileName, integer $userId)
  • string $fileName: Polar file name (full path name)
  • integer $userId: User ID (as in database)
_parse_block_get (line 71)

Parse a block from a Polar file (buffered)

A Block starts with a line [block_name]

  • return: Block name or null on error
string _parse_block_get (string &$buffer, integer &$line_no)
  • string &$buffer: Pointer to buffer
  • integer &$line_no: Pointer to line number where to start parsing. It contains the line number of the end of the block on return.
_parse_note (line 124)

Parse note to extract contest distance or interval training expression

Contest distance / Internal expression is in { }

  • Contest distance is D=<distance>, where <distance> is number of meters or <distance>m or <distance>k[m] or number of km if float number (contains . or ,). <distance> can be also a keyword in ('marathon','half','semi').
  • Interval training expression start with 'F='
Options also in { }
  • Shoe used : S=<shoe-name>[:<distance>[k[m]]] where <distance> is initial distance for shoe (in km if not specified)

  • return: Note with { } distance and options removed
string _parse_note (string $note, string &$exercise_type, integer &$distance, array &$int_training, array &$options)
  • string $note: Exercise note
  • integer &$distance: If 'contest' : official distance in meters
  • array &$int_training: If 'int_training' : Array of interval training elements (index from 0) :
    • repeat_nb : Nb of repetitions (integer >= 1)
    • work_distance : Distance of effort in meters
    • work_duration : Duration of effort in seconds
    • reco_distance : Distance of recovery in meters
    • reco_duration : Duration of recovery in seconds
  • array &$options: : Associative array of options :
    • shoe : Shoe name (ID)
    • shoe_ini_dist : Shoe optional init distance (meters)
    • footpod_id : Foot pod ID (1 digit, default : 1)
    • footpod_batt : Battery initial use (sec x10)
  • string &$exercise_type: &exercise_type exercise type : 'contest' for contest, 'int_training' for interval training, else 'training'.

Documentation generated on Sat, 28 Mar 2009 23:16:30 +0000 by phpDocumentor 1.4.1