From a9cea86c97970b66db496dff9bf36e21e93556bb Mon Sep 17 00:00:00 2001 From: Sanjeev Gupta Date: Thu, 9 Apr 2015 01:46:22 +0800 Subject: Update gpsd.php with correct definitions of GPS PRNs Please use canonical definitions, in gps.h --- gpsd.php.in | 27 +++++++++++++++++++-------- 1 file 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 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"/>

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.

+green=most and red=least. Diamonds indicate Augmentation satellites.

{$map_code} EOF; -- cgit v1.2.1