ADSB & Seismic fixes
This commit is contained in:
@@ -10,13 +10,13 @@ const canvas = ref<HTMLCanvasElement | null>(null);
|
|||||||
const W = 640, H = 120, MAX_PTS = 120;
|
const W = 640, H = 120, MAX_PTS = 120;
|
||||||
const SEG_W = W / (MAX_PTS - 1);
|
const SEG_W = W / (MAX_PTS - 1);
|
||||||
const SUB = 4;
|
const SUB = 4;
|
||||||
const PAD_SEGS = 3; // segments of breathing room at the right edge
|
const PAD_SEGS = 0;
|
||||||
|
|
||||||
let interval: ReturnType<typeof setInterval>;
|
let interval: ReturnType<typeof setInterval>;
|
||||||
let rafId: number;
|
let rafId: number;
|
||||||
let drawProgress = 0;
|
let drawProgress = 0;
|
||||||
let lastTimestamp = 0;
|
let lastTimestamp = 0;
|
||||||
const ANIM_DURATION = 950;
|
const ANIM_DURATION = 1100;
|
||||||
|
|
||||||
let pointBuffer: { x: number; y: number }[] = [];
|
let pointBuffer: { x: number; y: number }[] = [];
|
||||||
let prevMax = 1.0;
|
let prevMax = 1.0;
|
||||||
@@ -134,7 +134,7 @@ onUnmounted(() => {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
canvas { width: 100%; height: 60px; }
|
canvas { width: calc(100% - 16px); height: 60px; }
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|||||||
@@ -170,34 +170,6 @@ export function classifyAircraft(row) {
|
|||||||
return 'unknown';
|
return 'unknown';
|
||||||
}
|
}
|
||||||
|
|
||||||
async function scrapeHexDatabase(icao) {
|
|
||||||
const url = `https://hexdatabase.com/h/${icao}`;
|
|
||||||
try {
|
|
||||||
const resp = await fetch(url);
|
|
||||||
if (!resp.ok) return null;
|
|
||||||
const html = await resp.text();
|
|
||||||
const rowMatch = html.match(new RegExp(`<tr[^>]*>.*?<span[^>]*>.*?${icao}.*?<\/span>.*?<\/tr>`, 's'));
|
|
||||||
if (!rowMatch) return null;
|
|
||||||
// 0: Hex (ICAO), 1: Co (Country), 2: Reg (Registration), 3: Atype (Aircraft Type), 4: Operator, 5: Source, 6: MSN (Serial number), 7: Remarks (Description)
|
|
||||||
const cells = rowMatch.match(/<td[^>]*>.*?<\/td>/g) || [] || null;
|
|
||||||
const country = cells[1]?.replace(/<[^>]*>/g, '').trim() || null;
|
|
||||||
const registration = cells[2]?.replace(/<[^>]*>/g, '').trim() || null;
|
|
||||||
const aircraft = cells[3]?.replace(/<[^>]*>/g, '').trim() || null;
|
|
||||||
const operator = cells[4]?.replace(/<[^>]*>/g, '').trim() || null;
|
|
||||||
const serialNumber = cells[6]?.replace(/<[^>]*>/g, '').trim() || null;
|
|
||||||
|
|
||||||
return {
|
|
||||||
country,
|
|
||||||
registration,
|
|
||||||
aircraft,
|
|
||||||
operator,
|
|
||||||
serialNumber
|
|
||||||
};
|
|
||||||
} catch (e) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async function scrapeHexDatabase(icao) {
|
async function scrapeHexDatabase(icao) {
|
||||||
const url = `https://hexdatabase.com/h/${icao}`;
|
const url = `https://hexdatabase.com/h/${icao}`;
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user