default to using binCraft when working with readsb

This commit is contained in:
Matthias Wirth
2021-07-01 13:43:36 +02:00
parent aa5dd93f7b
commit aa61b4ba71
6 changed files with 21 additions and 8 deletions

View File

@@ -13,6 +13,13 @@ alias.url += (
"/INSTANCE/" => "HTMLPATH/"
)
$HTTP["url"] =~ "^/INSTANCE/data/.*\.binCraft$" {
compress.filetype = ()
setenv.add-response-header += (
"Cache-Control" => "no-cache",
"Content-Encoding" => "gzip",
)
}
$HTTP["url"] =~ "^/INSTANCE/chunks/chunk_.*gz$" {
setenv.add-response-header += (
"Access-Control-Allow-Origin" => "*",

View File

@@ -366,10 +366,10 @@ if (uuid != null) {
Dump1090Version = data.version;
RefreshInterval = data.refresh;
nHistoryItems = (data.history < 2) ? 0 : data.history;
binCraft = data.binCraft ? true : false;
binCraft = data.binCraft ? true : false || data.aircraft_binCraft ? true : false;
if (usp.has('noglobe') || usp.has('ptracks')) {
data.globeIndexGrid = null; // disable globe on user request
binCraft = false;
binCraft = data.aircraft_binCraft ? true : false;
}
dbServer = (data.dbServer && data.globeIndexGrid != null) ? true : false;

View File

@@ -346,7 +346,7 @@ function iOSVersion() {
function wqi(data) {
const buffer = data.buffer;
let vals = new Uint32Array(data.buffer, 0, 5);
let vals = new Uint32Array(data.buffer, 0, 8);
data.now = vals[0] / 1000 + vals[1] * 4294967.296;
let stride = vals[2];
data.global_ac_count_withpos = vals[3];
@@ -358,6 +358,8 @@ function wqi(data) {
data.north = limits[2];
data.east = limits[3];
data.messages = vals[7];
data.aircraft = [];
for (let off = stride; off < buffer.byteLength; off += stride) {
let ac = {}

View File

@@ -988,6 +988,8 @@ let TypeDesignatorIcons = {
'GAZL': ['gazelle', 1.00],
'AS50': ['gazelle', 1.00],
'AS55': ['gazelle', 1.00],
'ALO2': ['gazelle', 1.00],
'ALO3': ['gazelle', 1.00],
'R22': ['helicopter', 0.92],
'R44': ['helicopter', 0.94],

View File

@@ -261,7 +261,7 @@ function processReceiverUpdate(data, init) {
globeIndexNow[data.globeIndex] = data.now;
}
if (!uat && !init && !globeIndex && !binCraft)
if (!uat && !init && !globeIndex)
updateMessageRate(data);
// Loop through all the planes in the data packet
@@ -344,8 +344,10 @@ function fetchData(options) {
ac_url.push('data/globe' + mid + indexes[i].toString().padStart(4, '0') + suffix);
}
}
} else if (binCraft) {
ac_url.push = 'data/aircraft.binCraft';
} else {
ac_url[0] = 'data/aircraft.json';
ac_url.push = 'data/aircraft.json';
}
pendingFetches = ac_url.length;
@@ -5073,7 +5075,7 @@ function refreshInt() {
// handle globe case
if (binCraft && onlyMilitary && OLMap.getView().getZoom() < 5.5) {
if (binCraft && globeIndex && onlyMilitary && OLMap.getView().getZoom() < 5.5) {
refresh = 8000;
}

View File

@@ -23,9 +23,9 @@ location /INSTANCE/data/ {
add_header Cache-Control "public, max-age=0";
add_header Content-Encoding "gzip";
}
location ~ globe.*\.binCraft$ {
location ~ .*\.binCraft$ {
gzip off;
add_header Cache-Control "public, max-age=0";
add_header Cache-Control "no-cache";
add_header Content-Encoding "gzip";
}
}