diff options
author | Fred Wright <fw@fwright.net> | 2016-12-23 15:01:51 -0800 |
---|---|---|
committer | Fred Wright <fw@fwright.net> | 2016-12-23 15:01:51 -0800 |
commit | 98529eeb92112d9f39475163771b2bb9d9aa4aef (patch) | |
tree | 7ef22935cb30441a3274dc02187b903163f519f8 /gpsd.php.in | |
parent | e2471ddd5934d24dff6802bdbe4b38e83878cc01 (diff) | |
download | gpsd-98529eeb92112d9f39475163771b2bb9d9aa4aef.tar.gz |
Fixes a couple of minor gpsd.php issues.
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.
Diffstat (limited to 'gpsd.php.in')
-rw-r--r-- | gpsd.php.in | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gpsd.php.in b/gpsd.php.in index 43f84de1..9e76b461 100644 --- a/gpsd.php.in +++ b/gpsd.php.in @@ -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 @@ -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; @@ -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 { @@ -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... |