gpsd-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gpsd-dev] [PATCH 3/3] Document skyview.php


From: Sanjeev Gupta
Subject: [gpsd-dev] [PATCH 3/3] Document skyview.php
Date: Thu, 26 Mar 2015 23:49:26 +0800

Added comments and removed debugs.
---
 contrib/skyview.php | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/contrib/skyview.php b/contrib/skyview.php
index 38869d8..615dff9 100755
--- a/contrib/skyview.php
+++ b/contrib/skyview.php
@@ -1,6 +1,7 @@
 <?php
 
 # Copyright (c) 2006,2007 Chris Kuethe <address@hidden>
+# Copyright (c) 2015 Sanjeev Gupta <address@hidden>
 #
 # 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);
-- 
2.1.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]