Skip to content

Commit

Permalink
Add dump1090 aircraft.json format support, fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Ysurac committed Sep 25, 2017
1 parent 87b9d11 commit 9e0f727
Show file tree
Hide file tree
Showing 5 changed files with 172 additions and 132 deletions.
4 changes: 2 additions & 2 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,8 @@
?>
<li><div class="checkbox"><label><input type="checkbox" name="flightpopup" value="1" onclick="clickFlightPopup(this)" <?php if (isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true') print 'checked'; ?> ><?php echo _("Display flight info as popup"); ?></label></div></li>
<li><div class="checkbox"><label><input type="checkbox" name="flightpath" value="1" onclick="clickFlightPath(this)" <?php if ((isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true')) print 'checked'; ?> ><?php echo _("Display flight path"); ?></label></div></li>
<li><div class="checkbox"><label><input type="checkbox" name="flightroute" value="1" onclick="clickFlightRoute(this)" <?php if ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == 'true') || (isset($globalMapRoute) && $globalMapRoute)) print 'checked'; ?> ><?php echo _("Display flight route on click"); ?></label></div></li>
<li><div class="checkbox"><label><input type="checkbox" name="flightremainingroute" value="1" onclick="clickFlightRemainingRoute(this)" <?php if ((isset($_COOKIE['MapRemainingRoute']) && $_COOKIE['MapRemainingRoute'] == 'true') || !isset($_COOKIE['MapRemainingRoute']) || (isset($globalMapRemainingRoute) && $globalMapRemainingRoute)) print 'checked'; ?> ><?php echo _("Display flight remaining route on click"); ?></label></div></li>
<li><div class="checkbox"><label><input type="checkbox" name="flightroute" value="1" onclick="clickFlightRoute(this)" <?php if ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == 'true') || (!isset($_COOKIE['MapRoute']) && isset($globalMapRoute) && $globalMapRoute)) print 'checked'; ?> ><?php echo _("Display flight route on click"); ?></label></div></li>
<li><div class="checkbox"><label><input type="checkbox" name="flightremainingroute" value="1" onclick="clickFlightRemainingRoute(this)" <?php if ((isset($_COOKIE['MapRemainingRoute']) && $_COOKIE['MapRemainingRoute'] == 'true') || (!isset($_COOKIE['MapRemainingRoute']) && isset($globalMapRemainingRoute) && $globalMapRemainingRoute)) print 'checked'; ?> ><?php echo _("Display flight remaining route on click"); ?></label></div></li>
<li><div class="checkbox"><label><input type="checkbox" name="flightestimation" value="1" onclick="clickFlightEstimation(this)" <?php if ((isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'true') || (!isset($_COOKIE['flightestimation']) && !isset($globalMapEstimation)) || (!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation)) print 'checked'; ?> ><?php echo _("Planes animate between updates"); ?></label></div></li>
<?php
}
Expand Down
6 changes: 4 additions & 2 deletions install/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,6 @@
<option value="Mapbox" <?php if (isset($globalMapProvider) && $globalMapProvider == 'Mapbox') { ?>selected="selected" <?php } ?>>Mapbox</option>
<option value="MapQuest-OSM" <?php if (isset($globalMapProvider) && $globalMapProvider == 'MapQuest-OSM') { ?>selected="selected" <?php } ?>>MapQuest-OSM</option>
<option value="MapQuest-Aerial" <?php if (isset($globalMapProvider) && $globalMapProvider == 'MapQuest-Aerial') { ?>selected="selected" <?php } ?>>MapQuest-Aerial</option>
<option value="Google-Hybrid" <?php if (isset($globalMapProvider) && $globalMapProvider == 'Google-Hybrid') { ?>selected="selected" <?php } ?>>Google Hybrid</option>
<option value="Bing-Hybrid" <?php if (isset($globalMapProvider) && $globalMapProvider == 'Bing-Hybrid') { ?>selected="selected" <?php } ?>>Bing Hybrid</option>
<option value="Yandex" <?php if (isset($globalMapProvider) && $globalMapProvider == 'Yandex') { ?>selected="selected" <?php } ?>>Yandex</option>
</select>
Expand Down Expand Up @@ -532,6 +531,7 @@
<option value="sbs" <?php if (isset($source['format']) && $source['format'] == 'sbs') print 'selected'; ?>>SBS</option>
<option value="tsv" <?php if (isset($source['format']) && $source['format'] == 'tsv') print 'selected'; ?>>TSV</option>
<option value="raw" <?php if (isset($source['format']) && $source['format'] == 'raw') print 'selected'; ?>>Raw</option>
<option value="aircraftjson" <?php if (isset($source['format']) && $source['format'] == 'aircraftjson') print 'selected'; ?>>Dump1090 aircraft.json</option>
<option value="aprs" <?php if (isset($source['format']) && $source['format'] == 'aprs') print 'selected'; ?>>APRS</option>
<option value="deltadbtxt" <?php if (isset($source['format']) && $source['format'] == 'deltadbtxt') print 'selected'; ?>>Radarcape deltadb.txt</option>
<option value="vatsimtxt" <?php if (isset($source['format']) && $source['format'] == 'vatsimtxt') print 'selected'; ?>>Vatsim</option>
Expand Down Expand Up @@ -585,6 +585,7 @@
<option value="sbs">SBS</option>
<option value="tsv">TSV</option>
<option value="raw">Raw</option>
<option value="aircraftjson">Dump1090 aircraft.json</option>
<option value="aprs">APRS</option>
<option value="deltadbtxt">Radarcape deltadb.txt</option>
<option value="vatsimtxt">Vatsim</option>
Expand Down Expand Up @@ -629,7 +630,8 @@
<p class="help-block">For working source statistics, the name of the source <b>MUST</b> be the same as the source name of a source location, else center coverage latitude and longitude is used as source position. This is not available/usable with virtual airlines.</p>
<p class="help-block">FlightGear Singleplayer open an UDP server, the host should be <i>0.0.0.0</i>.</p>
<p class="help-block">Virtual Airlines Manager need to use the file <i>install/vAM/VAM-json.php</i> and the url <i>http://yourvaminstall/VAM-json.php</i>.</p>
<p class="help-block">HTTP and TCP sources can't be used at the same time.</p>
<p class="help-block">For a local file, you should use file:// before the path.</p>
<p class="help-block">URL and TCP sources can't be used at the same time.</p>
<!-- ' -->
<p class="help-block">Callback script is in <i>import/callback.php</i>. In host you can restrict access to some IP, Callback pass to restrict by a pass using <i>import/callback.php?pass=yourpass</i>.</p>
</fieldset>
Expand Down
4 changes: 2 additions & 2 deletions polar-geojson.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
header('Content-Type: text/javascript');


$polar = $Stats->getStatsSource(date('Y-m-d'),'polar');
$polar = $Stats->getStatsSource('polar',date('Y'),date('m'),date('d'));
$output = '{"type": "FeatureCollection","features": [';
if (!empty($polar)) {
foreach($polar as $eachpolar) {
$data = json_decode($eachpolar['source_data']);
$name = $eachpolar['source_name'];
$coord = $Location->getLocationInfobySourceName($name);
$output .= '{"type": "Feature","properties": {"name": "'.$name.'","style": {"color": "#B5DAB1", "opacity": 0.6}},"geometry": {"type": "Polygon","coordinates": [[';
$output .= '{"type": "Feature","properties": {"name": "'.$name.'","style": {"color": "#B5DAB1", "opacity": 1.0}},"geometry": {"type": "Polygon","coordinates": [[';
if (isset($coord[0]['latitude'])) {
$initial_latitude = $coord[0]['latitude'];
$initial_longitude = $coord[0]['longitude'];
Expand Down
3 changes: 1 addition & 2 deletions require/class.SpotterImport.php
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,7 @@ public function add($line) {
$Spotter->db = null;
}
$this->all_flights[$id] = array_merge($this->all_flights[$id],array('aircraft_icao' => $icao));
}
if (!isset($this->all_flights[$id]['aircraft_icao']) && isset($line['aircraft_name'])) {
} elseif (!isset($this->all_flights[$id]['aircraft_icao']) && isset($line['aircraft_name'])) {
if (!isset($globalNoDB) || $globalNoDB !== TRUE) {
// Get aircraft ICAO from aircraft name
$Spotter = new Spotter($this->db);
Expand Down
Loading

0 comments on commit 9e0f727

Please sign in to comment.