diff options
author | Gary E. Miller <gem@rellim.com> | 2015-03-25 14:02:39 -0700 |
---|---|---|
committer | Gary E. Miller <gem@rellim.com> | 2015-03-25 14:02:39 -0700 |
commit | 27ed001a734aaac2310c855d20fdb027357a0585 (patch) | |
tree | 1a8a9692448e06a6283fd8aabfe81279e4f4c12d /contrib/maxsats.pl | |
parent | 3ef586101133219f6782b7cb3f437c2fb85f0147 (diff) | |
download | gpsd-27ed001a734aaac2310c855d20fdb027357a0585.tar.gz |
Revert "Removed contrib/skyview.php amd contrib/maxsats.pl, they used the old protocol."
This reverts commit 0dac112485e7a7117bd9ac735625f20e10750e79.
Sanjeev Gupta wants a chance to fix the old programs.
Diffstat (limited to 'contrib/maxsats.pl')
-rwxr-xr-x | contrib/maxsats.pl | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/contrib/maxsats.pl b/contrib/maxsats.pl new file mode 100755 index 00000000..6475b2db --- /dev/null +++ b/contrib/maxsats.pl @@ -0,0 +1,41 @@ +#!/usr/bin/perl + +# Copyright (c) 2008 Chris Kuethe <chris.kuethe@gmail.com> +# +# Permission to use, copy, modify, and distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +use strict; +use warnings; + +my ($tm, $nsr, $nt, $nu, @TL, @UL, $l); +while (<>){ + next unless (/,Y=\w+ (\d+\.\d+) (\d+):(.+:)/); + $tm = $1; + $nsr = $2; + $l = ":$3:"; + $nt = $nu = 0; + @TL = @UL = (); + while ($l =~ /(\d+) \w+ \w+ (\d+) ([01]):/g){ + if ($1 <= 32){ # $1 => prn + if ($2){ # $2 => snr + push(@TL, $1); + $nt++; + } + if ($3){ # $3 => used + push(@UL, $1); + $nu++; + } + } + } + print "$tm $nsr nu/nt = $nu/$nt T=\[@TL\] U=\[@UL\]\n" if (($nu >= 10)); +} |