Skip to content

Commit

Permalink
Fixes a couple of minor gpsd.php issues.
Browse files Browse the repository at this point in the history
1) This excludes satellites with zero azimuth and elevation from the
skyview display.  This is mainly for receivers (e.g. Navika-100) which
fail to report az/el for SBAS satellites, avoiding displaying them
erroneously at the top.  There was already a filtering condition to
exclude satellites with az, el, and SNR all 0; this simply removes the
SNR portion of the condition.

2) The default skyview orientation is now the downward-facing "map
view".  In spite of the name, GPS skyviews pretty much always use this
orientation rather than the upward-facing view suggested by the name
(the former snarky comment on the parameter notwithstanding).

TESTED:
Viewed the page simultaneously with xgps with "bad" SBAS entries
present, and verified consistent behavior.
  • Loading branch information
fhgwright committed Dec 23, 2016
1 parent e2471dd commit 98529ee
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions gpsd.php.in
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ function radial($angle, $sz){

function azel2xy($az, $el, $sz){
global $swap_ew;
#rotate coords... 90deg W = 180deg trig
#rotate coords... 90deg E = 180deg trig
$az += 270;

#turn into radians
Expand All @@ -195,14 +195,14 @@ function azel2xy($az, $el, $sz){
# and convert length/azimuth to cartesian
$x = sprintf("%d", (($sz * 0.5) + ($r * cos($az))));
$y = sprintf("%d", (($sz * 0.5) + ($r * sin($az))));
if ($swap_ew == 0)
if ($swap_ew != 0)
$x = $sz - $x;

return array($x, $y);
}

function splot($im, $sz, $C, $e){
if ((0 == $e['PRN']) || (0 == $e['az'] + $e['el'] + $e['ss']) ||
if ((0 == $e['PRN']) || (0 == $e['az'] + $e['el']) ||
($e['az'] < 0) || ($e['el'] < 0))
return;

Expand Down Expand Up @@ -297,7 +297,7 @@ function skyview($im, $sz, $C){

imageString($im, 4, $sz/2 + 4, 2 , 'N', $C['black']);
imageString($im, 4, $sz/2 + 4, $sz - 16 , 'S', $C['black']);
if ($swap_ew == 0){
if ($swap_ew != 0){
imageString($im, 4, 4 , $sz/2 + 4, 'E', $C['black']);
imageString($im, 4, $sz - 10 , $sz/2 + 4, 'W', $C['black']);
} else {
Expand Down Expand Up @@ -538,7 +538,7 @@ function write_config(){
\$autorefresh = 0; # number of seconds after which to refresh
\$showmap = 0; # set to 1 if you want to have a google map, set it to 2 if you want a map based on openstreetmap
\$gmap_key = 'GetYourOwnGoogleKey'; # your google API key goes here
\$swap_ew = 0; # set to 1 if you don't understand projections
\$swap_ew = 0; # set to 1 for upward facing view (nonstandard)
\$open = 0; # set to 1 to show the form to change the GPSd server

## You can read the header, footer and blurb from a file...
Expand Down

0 comments on commit 98529ee

Please sign in to comment.