Update of /cvsroot/pyxida/Pyxida/bin
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15060/bin
Added Files:
animateNC.pl
Log Message:
Started writing a perl script that creates an animation from a Pyxida coords log file.
--- NEW FILE: animateNC.pl ---
#!/usr/bin/perl -w
use strict;
use Getopt::Std;
my %params = ();
my %pos = ();
getopts("f:", \%params);
my $frameTime = 60;
$frameTime = $params{'f'} if defined $params{'f'};
while (my $line = <>) {
if ($line =~ m/\w\w (\d+) .* addr=(.+) c=\[(.+),(.+),(.+),(.+),h(.+)\]/) {
my ($ts, $addr, $a, $b, $c, $d, $h) = ($1, $2, $3, $4, $5, $6, $7);
my $dateTS = localtime($ts / 1000);
#print STDERR "$dateTS $ts $addr $a $b $c $d $h\n";
$pos{$addr} = [$a, $b, $c]; #, $d, $h];
}
}
print "splot '-'\n";
foreach my $addr (keys %pos) {
my $o = "";
foreach my $c (@{$pos{$addr}}) {
$o .= "$c ";
}
chop $o;
print "$o\n";
}
print "e\n";
sub fixedNum() {
my $num = shift;
my $result = sprintf("%08d", $num);
return $result;
}
|