summaryrefslogtreecommitdiff
path: root/contrib/skyview.php
diff options
context:
space:
mode:
authorSanjeev Gupta <ghane0@gmail.com>2015-03-26 23:49:26 +0800
committerGary E. Miller <gem@rellim.com>2015-03-26 12:46:03 -0700
commit69363ba624062c55dee027a6692406e5d5b2e82d (patch)
treeff9ed20bdb8ff81eecdf8a330eb499209b0f8100 /contrib/skyview.php
parent3f8133bbea6a17dcb287de5595206bd2c3e89e0a (diff)
downloadgpsd-69363ba624062c55dee027a6692406e5d5b2e82d.tar.gz
Document skyview.php
Added comments and removed debugs. Signed-off-by: Gary E. Miller <gem@rellim.com>
Diffstat (limited to 'contrib/skyview.php')
-rwxr-xr-xcontrib/skyview.php19
1 files changed, 17 insertions, 2 deletions
diff --git a/contrib/skyview.php b/contrib/skyview.php
index 38869d8e..615dff91 100755
--- a/contrib/skyview.php
+++ b/contrib/skyview.php
@@ -1,6 +1,7 @@
<?php
# Copyright (c) 2006,2007 Chris Kuethe <chris.kuethe@gmail.com>
+# Copyright (c) 2015 Sanjeev Gupta <ghane0@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
@@ -14,6 +15,22 @@
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+// This program originally read a logfile of filtered gpsd messages,
+// type Y. The gpsd protocal changed in 2.90, since when this became
+// non-functional.
+//
+// The program has been updated (the first while loop) to read messages
+// over tcp; of type SKY. These are unpacked from JSON. No attempt has
+// been made to touch the actual calculation or plotting routines.
+//
+// Because it now reads a live stream, the program must be run with an
+// option, "count", to specify the number of SKY messages it reads. SKY
+// messages are ussually emitted every 5 secs, so a number close to 700
+// will cover an hour's worth.
+//
+// Tested to work with php5.6 , although earlier versions may work.
+//
+
$cellmode = 0;
if ($argc != 3){
if (($argc != 4) || strcmp("cells", $argv[3])){
@@ -30,7 +47,6 @@ $filled = 0;
$j = 0 ;
$count = $argv[1] ;
-print $count ;
$im = imageCreate($sz, $sz);
$C = colorsetup($im);
@@ -66,7 +82,6 @@ while (($out = socket_read($socket, 2048)) && ( $j < $count) ){
if (strpos($out, "SKY")) {
- print $j ;
$j = $j + 1;
$PRN = json_decode($out,true);