[lug] Bicycle Computers
Rob Nagler
nagler at bivio.biz
Fri May 6 06:32:34 MDT 2011
On Thu, May 5, 2011 at 4:09 PM, Robert Racansky wrote:
> I prefer the wrist-worn GPS units over the bike-mounted, so I can use
> them for running and cross-country skiing, also.
My 305 does both. There's a bike mount which is very easy to use.
> With the heart rate monitor, the paramedics who find my body will be
:)
I use it on a Mac, too. The export format is easy to parse (see
program below). I just use it to suck the data off the device. I'm
pretty sure it would be easy to write a driver to suck the data off
directly from the USB port.
Rob
--------------------------------------------------------
use strict;
use Bivio::Util::CSV;
my($rows) = [];
my($row);
my($tag);
my($in_track);
my($header) = [];
while (<>) {
if ($_ =~ m{<Track>}) {
$in_track = 1;
}
elsif ($in_track) {
$in_track = 0
if $_ =~ m{</Track>};
next;
}
last
if $_ =~ m{</Activities>};
if ($_ =~ m{<Lap StartTime="(\S+)">}) {
push(@$rows, $row = [$1]);
push(@$header, 'StartTime')
if @$rows == 1;
}
if ($_ =~ m{<(TotalTimeSeconds|DistanceMeters|MaximumSpeed|Calories|Value)>(\S+)</\w+>})
{
push(@$row, $2);
push(@$header, $tag || $1)
if @$rows == 1;
$tag = undef;
}
elsif ($_ =~ m{<(AverageHeartRateBpm|MaximumHeartRateBpm) }) {
$tag = $1;
}
}
unshift(@$rows, $header);
print ${Bivio::Util::CSV->to_csv_text($rows)};
More information about the LUG
mailing list