Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Ysurac committed Jun 27, 2017
1 parent 8dc4cc7 commit f2b14ed
Show file tree
Hide file tree
Showing 3 changed files with 200 additions and 90 deletions.
2 changes: 2 additions & 0 deletions location-data.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
print '<div class="top">';
if ($spotter_item['name'] != '') print '<div class="right"><div class="callsign-details"><div class="callsign">'.$spotter_item['name'].'</div>';
elseif ($spotter_item['location_id'] != 0) print '<div class="right"><div class="callsign-details"><div class="callsign">'.$spotter_item['location_id'].'</div>';
elseif ($spotter_item['type'] == 'lightning') print '<div class="right"><div class="callsign-details"><div class="callsign">'._("Lightning").'</div>';
elseif ($spotter_item['type'] == 'wx') print '<div class="right"><div class="callsign-details"><div class="callsign">'._("Weather Station").'</div>';
else print '<div class="right"><div class="callsign-details"><div class="callsign"></div>';
print '</div>';

Expand Down
9 changes: 9 additions & 0 deletions require/class.APRS.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php
require_once(dirname(__FILE__).'/settings.php');
require_once(dirname(__FILE__).'/class.Common.php');
require_once(dirname(__FILE__).'/class.GeoidHeight.php');
class aprs {
private $socket;
private $connected = false;
Expand Down Expand Up @@ -649,6 +650,8 @@ class APRSSpotter extends APRS {
public function addLiveSpotterData($id,$ident,$aircraft_icao,$departure_airport,$arrival_airport,$latitude,$longitude,$waypoints,$altitude,$altitude_real,$heading,$speed,$datetime,$departure_airport_time,$arrival_airport_time,$squawk,$route_stop,$hex,$putinarchive,$registration,$pilot_id,$pilot_name, $verticalrate, $noarchive, $ground,$format_source,$source_name,$over_country) {
$Common = new Common();
if ($latitude != '' && $longitude != '') {
$lat = $latitude;
$long = $longitude;
$latitude = $Common->convertDM($latitude,'latitude');
$longitude = $Common->convertDM($longitude,'longitude');
$coordinate = sprintf("%02d",$latitude['deg']).str_pad(number_format($latitude['min'],2,'.',''),5,'0',STR_PAD_LEFT).$latitude['NSEW'].'/'.sprintf("%03d",$longitude['deg']).str_pad(number_format($longitude['min'],2,'.',''),5,'0',STR_PAD_LEFT).$longitude['NSEW'];
Expand All @@ -674,6 +677,12 @@ public function addLiveSpotterData($id,$ident,$aircraft_icao,$departure_airport,
$custom .= 'AI='.$aircraft_icao;
}
if ($custom != '') $custom = ' '.$custom;
/*
// Use AMSL altitude
$GeoidClass = new GeoidHeight();
$geoid= round($GeoidClass->get($lat,$long)*3.28084,2);
$altitude_real = round($altitude_real + $geoid);
*/
$this->send('AIRCRAFT>APRS,TCPIP*:;'.$hex.' *'.date('His',strtotime($datetime)).'h'.$coordinate.'^'.str_pad($heading,3,'0',STR_PAD_LEFT).'/'.str_pad($speed,3,'0',STR_PAD_LEFT).'/A='.str_pad($altitude_real,6,'0',STR_PAD_LEFT).' !W'.$w.'!'.$custom."\n");
}
}
Expand Down
Loading

0 comments on commit f2b14ed

Please sign in to comment.