summaryrefslogtreecommitdiff
path: root/gpsd.php.in
diff options
context:
space:
mode:
authorSanjeev Gupta <ghane0@gmail.com>2015-04-09 01:46:22 +0800
committerEric S. Raymond <esr@thyrsus.com>2015-04-08 17:40:03 -0400
commita9cea86c97970b66db496dff9bf36e21e93556bb (patch)
tree0035fc0c50c13c783ec68d4c22ce46188457dad5 /gpsd.php.in
parent3686c29c2356a05ba5e9332860a841a5428ec872 (diff)
downloadgpsd-a9cea86c97970b66db496dff9bf36e21e93556bb.tar.gz
Update gpsd.php with correct definitions of GPS PRNs
Please use canonical definitions, in gps.h
Diffstat (limited to 'gpsd.php.in')
-rw-r--r--gpsd.php.in27
1 files changed, 19 insertions, 8 deletions
diff --git a/gpsd.php.in b/gpsd.php.in
index 75b708a6..a6f20459 100644
--- a/gpsd.php.in
+++ b/gpsd.php.in
@@ -119,6 +119,16 @@ else
exit(0);
###########################################################################
+# Function to decide if a PRN is a true GPS bird or SBAS, GBAS, etc.
+# Sanjeev Gupta <ghane0@gmail.com> 20150408
+# Please refer to gps.h lines ~~ 95 , for a central definition
+function isGPS($PRN) {
+ if ($PRN <= 32) return TRUE ; # Navstar GPS
+ if ($PRN >= 64 && $PRN <= 96) return TRUE ; # GLONASS
+ if ($PRN >= 159 ) return TRUE ; # BeiDou ?
+ return FALSE ; # SBAS, GBAS, unknown
+ }
+
function colorsetup($im){
$C['white'] = imageColorAllocate($im, 255, 255, 255);
$C['ltgray'] = imageColorAllocate($im, 191, 191, 191);
@@ -215,18 +225,19 @@ function splot($im, $sz, $C, $e){
$r = 8;
imageString($im, 3, $x+4, $y+4, $e['PRN'], $C['black']);
- if ($e['used'] == true)
- if ($e['PRN'] > 32)
- imageFilledDiamond($im, $x, $y, $r, $color);
- else
+ if ($e['used'] == true)
+ if (isGPS($e['PRN']))
imageFilledArc($im, $x, $y, $r, $r, 0, 360, $color, 0);
- else
- if ($e['PRN'] > 32)
- imageDiamond($im, $x, $y, $r, $color);
else
+ imageFilledDiamond($im, $x, $y, $r, $color);
+ else
+ if (isGPS($e['PRN']))
imageArc($im, $x, $y, $r, $r, 0, 360, $color);
+ else
+ imageDiamond($im, $x, $y, $r, $color);
}
+
function imageDiamond($im, $x, $y, $r, $color){
$t = $r/2;
# this lunacy is because imagesetthickness doesn't seem to work
@@ -419,7 +430,7 @@ width="600" height="600"/>
<br clear="all"/>
<p class="caption">A filled circle means the satellite was used in
the last fix. Green-yellow-red colors indicate signal strength in dB,
-green=most and red=least. Diamonds indicate SBAS satellites.</p>
+green=most and red=least. Diamonds indicate Augmentation satellites.</p>
{$map_code}</td>
</tr>
EOF;