[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [gpsd-dev] [PATCH] Update gpsd.php with correct definitions of GPS P
From: |
Gary E. Miller |
Subject: |
Re: [gpsd-dev] [PATCH] Update gpsd.php with correct definitions of GPS PRNs |
Date: |
Wed, 8 Apr 2015 12:38:08 -0700 |
Yo Sanjeev!
The php looks good to me, I wait for esr to comment on the isGPS() as
he is up to date on that part.
On Thu, 9 Apr 2015 01:46:22 +0800
Sanjeev Gupta <address@hidden> wrote:
> 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 75b708a..a6f2045 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 <address@hidden> 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;
RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97701
address@hidden Tel:+1(541)382-8588