Update index.html
Browse files- index.html +285 -358
index.html
CHANGED
@@ -2,11 +2,9 @@
|
|
2 |
<html>
|
3 |
<head>
|
4 |
<meta charset="UTF-8">
|
5 |
-
<title>Global SDR
|
6 |
-
<!-- Leaflet CSS -->
|
7 |
-
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/leaflet.min.css" />
|
8 |
<style>
|
9 |
-
/*
|
10 |
body {
|
11 |
margin: 0;
|
12 |
padding: 20px;
|
@@ -26,15 +24,14 @@
|
|
26 |
border-radius: 8px;
|
27 |
height: calc(100vh - 40px);
|
28 |
overflow-y: auto;
|
29 |
-
z-index: 1000;
|
30 |
}
|
31 |
#map {
|
32 |
-
height: calc(100vh - 40px);
|
33 |
-
border-radius: 8px;
|
34 |
background: #111;
|
|
|
|
|
35 |
}
|
36 |
|
37 |
-
/* μμ κΈ°(
|
38 |
.receiver {
|
39 |
margin: 10px 0;
|
40 |
padding: 10px;
|
@@ -79,7 +76,7 @@
|
|
79 |
transition: width 0.3s;
|
80 |
}
|
81 |
|
82 |
-
/* νμ§(
|
83 |
.detection {
|
84 |
padding: 5px;
|
85 |
margin: 5px 0;
|
@@ -87,29 +84,13 @@
|
|
87 |
border-left: 2px solid #0f0;
|
88 |
}
|
89 |
|
90 |
-
/*
|
91 |
-
.
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
.leaflet-control-attribution {
|
98 |
-
background: #222 !important;
|
99 |
-
color: #666 !important;
|
100 |
-
}
|
101 |
-
.leaflet-popup-content-wrapper,
|
102 |
-
.leaflet-popup-tip {
|
103 |
-
background: #222 !important;
|
104 |
-
color: #0f0 !important;
|
105 |
-
}
|
106 |
-
|
107 |
-
/* μ€ν
μ΄μ
λ²μ μ νμ */
|
108 |
-
.station-range {
|
109 |
-
stroke: #0f0;
|
110 |
-
stroke-width: 1;
|
111 |
-
fill: #0f0;
|
112 |
-
fill-opacity: 0.1;
|
113 |
}
|
114 |
</style>
|
115 |
</head>
|
@@ -117,23 +98,25 @@
|
|
117 |
<div class="container">
|
118 |
<!-- μ¬μ΄λλ° -->
|
119 |
<div class="sidebar">
|
120 |
-
<
|
|
|
|
|
121 |
<div id="receivers"></div>
|
122 |
|
123 |
<h3>Real-time Detections</h3>
|
124 |
<div id="detections"></div>
|
|
|
|
|
|
|
125 |
</div>
|
126 |
|
127 |
-
<!--
|
128 |
-
<
|
129 |
</div>
|
130 |
|
131 |
-
<!-- Leaflet JS -->
|
132 |
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/leaflet.min.js"></script>
|
133 |
<script>
|
134 |
-
//
|
135 |
const sdrStations = [
|
136 |
-
// Europe
|
137 |
{
|
138 |
name: "Twente WebSDR",
|
139 |
url: "websdr.ewi.utwente.nl:8901",
|
@@ -142,22 +125,6 @@
|
|
142 |
range: 200,
|
143 |
active: true
|
144 |
},
|
145 |
-
{
|
146 |
-
name: "TU Delft WebSDR",
|
147 |
-
url: "websdr.tudelft.nl:8901",
|
148 |
-
location: [51.9981, 4.3731],
|
149 |
-
frequency: "0-29.160 MHz",
|
150 |
-
range: 180,
|
151 |
-
active: true
|
152 |
-
},
|
153 |
-
{
|
154 |
-
name: "SUWS WebSDR UK",
|
155 |
-
url: "websdr.suws.org.uk",
|
156 |
-
location: [51.2785, -0.7642],
|
157 |
-
frequency: "0-30 MHz",
|
158 |
-
range: 150,
|
159 |
-
active: true
|
160 |
-
},
|
161 |
{
|
162 |
name: "KiwiSDR Switzerland",
|
163 |
url: "hb9ryz.no-ip.org:8073",
|
@@ -166,235 +133,64 @@
|
|
166 |
range: 160,
|
167 |
active: true
|
168 |
},
|
169 |
-
// United States
|
170 |
-
{
|
171 |
-
name: "W6DRZ WebSDR",
|
172 |
-
url: "w6drz.sdr.us:8901",
|
173 |
-
location: [34.2847, -118.4429],
|
174 |
-
frequency: "0-30 MHz",
|
175 |
-
range: 170,
|
176 |
-
active: true
|
177 |
-
},
|
178 |
-
{
|
179 |
-
name: "K3FEF WebSDR",
|
180 |
-
url: "k3fef.sdr.us:8901",
|
181 |
-
location: [40.5697, -75.9363],
|
182 |
-
frequency: "0-30 MHz",
|
183 |
-
range: 160,
|
184 |
-
active: true
|
185 |
-
},
|
186 |
{
|
187 |
-
name: "
|
188 |
-
url: "
|
189 |
-
location: [
|
190 |
-
frequency: "0-30 MHz",
|
191 |
-
range: 150,
|
192 |
-
active: true
|
193 |
-
},
|
194 |
-
{
|
195 |
-
name: "W4AX WebSDR",
|
196 |
-
url: "w4ax.sdr.us:8901",
|
197 |
-
location: [33.7756, -84.3963],
|
198 |
-
frequency: "0-30 MHz",
|
199 |
-
range: 165,
|
200 |
-
active: true
|
201 |
-
},
|
202 |
-
// Japan
|
203 |
-
{
|
204 |
-
name: "JH7VHZ WebSDR",
|
205 |
-
url: "jh7vhz.sdr.jp:8901",
|
206 |
-
location: [38.2682, 140.8694],
|
207 |
-
frequency: "0-30 MHz",
|
208 |
-
range: 155,
|
209 |
-
active: true
|
210 |
-
},
|
211 |
-
{
|
212 |
-
name: "JA1GJB KiwiSDR",
|
213 |
-
url: "ja1gjb.sdr.jp:8073",
|
214 |
-
location: [35.6762, 139.6503],
|
215 |
-
frequency: "0-30 MHz",
|
216 |
-
range: 145,
|
217 |
-
active: true
|
218 |
-
},
|
219 |
-
{
|
220 |
-
name: "JA3ZOH WebSDR",
|
221 |
-
url: "ja3zoh.sdr.jp:8901",
|
222 |
-
location: [34.6937, 135.5023],
|
223 |
-
frequency: "0-30 MHz",
|
224 |
-
range: 150,
|
225 |
-
active: true
|
226 |
-
},
|
227 |
-
// Australia
|
228 |
-
{
|
229 |
-
name: "VK4YA KiwiSDR",
|
230 |
-
url: "vk4ya.sdr.au:8073",
|
231 |
-
location: [-27.4698, 153.0251],
|
232 |
-
frequency: "0-30 MHz",
|
233 |
-
range: 170,
|
234 |
-
active: true
|
235 |
-
},
|
236 |
-
{
|
237 |
-
name: "VK2RG WebSDR",
|
238 |
-
url: "vk2rg.sdr.au:8901",
|
239 |
-
location: [-33.8688, 151.2093],
|
240 |
-
frequency: "0-30 MHz",
|
241 |
-
range: 165,
|
242 |
-
active: true
|
243 |
-
},
|
244 |
-
// Russia
|
245 |
-
{
|
246 |
-
name: "RZ3DJR WebSDR",
|
247 |
-
url: "rz3djr.sdr.ru:8901",
|
248 |
-
location: [55.7558, 37.6173],
|
249 |
-
frequency: "0-30 MHz",
|
250 |
-
range: 180,
|
251 |
-
active: true
|
252 |
-
},
|
253 |
-
{
|
254 |
-
name: "UA9UDX WebSDR",
|
255 |
-
url: "ua9udx.sdr.ru:8901",
|
256 |
-
location: [55.0084, 82.9357],
|
257 |
-
frequency: "0-30 MHz",
|
258 |
-
range: 175,
|
259 |
-
active: true
|
260 |
-
},
|
261 |
-
// China
|
262 |
-
{
|
263 |
-
name: "BY1PK WebSDR",
|
264 |
-
url: "by1pk.sdr.cn:8901",
|
265 |
-
location: [39.9042, 116.4074],
|
266 |
-
frequency: "0-30 MHz",
|
267 |
-
range: 160,
|
268 |
-
active: true
|
269 |
-
},
|
270 |
-
{
|
271 |
-
name: "BG3MDO KiwiSDR",
|
272 |
-
url: "bg3mdo.sdr.cn:8073",
|
273 |
-
location: [23.1291, 113.2644],
|
274 |
-
frequency: "0-30 MHz",
|
275 |
-
range: 155,
|
276 |
-
active: true
|
277 |
-
},
|
278 |
-
// South Korea
|
279 |
-
{
|
280 |
-
name: "HL2WA KiwiSDR",
|
281 |
-
url: "hl2wa.sdr.kr:8073",
|
282 |
-
location: [37.5665, 126.9780],
|
283 |
frequency: "0-30 MHz",
|
284 |
range: 150,
|
285 |
active: true
|
286 |
-
},
|
287 |
-
{
|
288 |
-
name: "DS1URB WebSDR",
|
289 |
-
url: "ds1urb.sdr.kr:8901",
|
290 |
-
location: [35.1796, 129.0756],
|
291 |
-
frequency: "0-30 MHz",
|
292 |
-
range: 145,
|
293 |
-
active: true
|
294 |
-
},
|
295 |
-
// Canada
|
296 |
-
{
|
297 |
-
name: "VE3HOA WebSDR",
|
298 |
-
url: "ve3hoa.sdr.ca:8901",
|
299 |
-
location: [43.6532, -79.3832],
|
300 |
-
frequency: "0-30 MHz",
|
301 |
-
range: 165,
|
302 |
-
active: true
|
303 |
-
},
|
304 |
-
{
|
305 |
-
name: "VA3ROM KiwiSDR",
|
306 |
-
url: "va3rom.sdr.ca:8073",
|
307 |
-
location: [45.4215, -75.6972],
|
308 |
-
frequency: "0-30 MHz",
|
309 |
-
range: 160,
|
310 |
-
active: true
|
311 |
-
},
|
312 |
-
// Brazil
|
313 |
-
{
|
314 |
-
name: "PY2RDZ WebSDR",
|
315 |
-
url: "py2rdz.sdr.br:8901",
|
316 |
-
location: [-23.5505, -46.6333],
|
317 |
-
frequency: "0-30 MHz",
|
318 |
-
range: 170,
|
319 |
-
active: true
|
320 |
-
},
|
321 |
-
{
|
322 |
-
name: "PY1ZV KiwiSDR",
|
323 |
-
url: "py1zv.sdr.br:8073",
|
324 |
-
location: [-22.9068, -43.1729],
|
325 |
-
frequency: "0-30 MHz",
|
326 |
-
range: 165,
|
327 |
-
active: true
|
328 |
}
|
329 |
];
|
330 |
|
331 |
-
// Leaflet + λμ νκ² μΆμ μ ν΅ν©ν RadarSystem
|
332 |
class RadarSystem {
|
333 |
constructor() {
|
334 |
-
//
|
|
|
|
|
|
|
|
|
335 |
this.targets = new Set();
|
336 |
-
// νκ² λ§μ»€μ μ νΈ λΌμΈμ μ μ₯ν μλ£κ΅¬μ‘°
|
337 |
-
this.markers = new Map();
|
338 |
-
this.signalLines = new Map();
|
339 |
|
340 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
341 |
this.renderReceivers();
|
342 |
this.startTracking();
|
343 |
}
|
344 |
|
345 |
-
//
|
346 |
-
|
347 |
-
this.
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
});
|
353 |
-
|
354 |
-
// OpenStreetMap νμΌ λ μ΄μ΄
|
355 |
-
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
356 |
-
maxZoom: 19,
|
357 |
-
attribution: 'Β© OpenStreetMap contributors'
|
358 |
-
}).addTo(this.map);
|
359 |
-
|
360 |
-
// κ° SDR μ€ν
μ΄μ
μ μ§λμ νμ
|
361 |
-
sdrStations.forEach(station => {
|
362 |
-
// μ€ν
μ΄μ
μμΉ λ§μ»€
|
363 |
-
const marker = L.circleMarker(station.location, {
|
364 |
-
radius: 5,
|
365 |
-
color: '#0f0',
|
366 |
-
fillColor: '#0f0',
|
367 |
-
fillOpacity: 1
|
368 |
-
}).addTo(this.map);
|
369 |
-
|
370 |
-
// μ€ν
μ΄μ
μ κ°μ² λ²μ(coverage range)λ₯Ό μμΌλ‘ νμ
|
371 |
-
L.circle(station.location, {
|
372 |
-
radius: station.range * 1000, // km -> m
|
373 |
-
className: 'station-range'
|
374 |
-
}).addTo(this.map);
|
375 |
-
|
376 |
-
// λ§μ»€ ν΄ν(λ§μ°μ€ μ€λ² μ μ 보)
|
377 |
-
marker.bindTooltip(`
|
378 |
-
${station.name}<br>
|
379 |
-
Frequency: ${station.frequency}<br>
|
380 |
-
Range: ${station.range}km
|
381 |
-
`);
|
382 |
});
|
383 |
}
|
384 |
|
385 |
-
// μ¬μ΄λλ°μ μμ κΈ°
|
386 |
renderReceivers() {
|
387 |
const container = document.getElementById('receivers');
|
388 |
-
container.innerHTML = sdrStations.map(
|
389 |
-
<div class="receiver" id="rx-${
|
390 |
<div class="status">
|
391 |
-
<div class="led ${
|
392 |
-
<strong>${
|
393 |
</div>
|
394 |
-
<div>π‘ ${
|
395 |
-
<div>π» ${
|
396 |
-
<div>π ${
|
397 |
-
<div>Range: ${
|
398 |
<div class="signal-strength">
|
399 |
<div class="signal-bar"></div>
|
400 |
</div>
|
@@ -402,145 +198,276 @@
|
|
402 |
`).join('');
|
403 |
}
|
404 |
|
405 |
-
//
|
406 |
-
// (λ λ²μ§Έ μ½λμ μμ΄λμ΄μ, 첫 λ²μ§Έ μ½λμ 'μ€ν
μ΄μ
κ·Όμ²' λ°©μμ κ²°ν©)
|
407 |
generateTarget() {
|
408 |
-
// μμ
|
409 |
-
const
|
410 |
-
// station κ·Όμ²μ λνλλλ‘ μ‘°μ (Β±5λ λ²μ)
|
411 |
-
const range = 5;
|
412 |
return {
|
413 |
-
type: Math.random() > 0.7 ? 'aircraft' : 'vehicle',
|
414 |
-
position: {
|
415 |
-
lat: station.location[0] + (Math.random() - 0.5) * range,
|
416 |
-
lon: station.location[1] + (Math.random() - 0.5) * range
|
417 |
-
},
|
418 |
-
speed: Math.random() * 500 + 200, // kts
|
419 |
-
altitude: Math.random() * 35000 + 5000, // ft
|
420 |
-
heading: Math.random() * 360,
|
421 |
id: Math.random().toString(36).substr(2, 6).toUpperCase(),
|
|
|
|
|
|
|
|
|
|
|
|
|
422 |
signalStrength: Math.random()
|
423 |
};
|
424 |
}
|
425 |
|
426 |
-
//
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
431 |
|
432 |
-
|
433 |
-
|
434 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
435 |
|
436 |
-
|
|
|
437 |
this.targets.forEach(target => {
|
438 |
-
// νκ²
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
Type: ${target.type}<br>
|
450 |
-
Speed: ${target.speed.toFixed(0)}kts<br>
|
451 |
-
${
|
452 |
-
target.type === 'aircraft'
|
453 |
-
? `Altitude: ${target.altitude.toFixed(0)}ft<br>`
|
454 |
-
: ''
|
455 |
}
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
this.
|
|
|
|
|
483 |
}
|
484 |
}
|
485 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
486 |
});
|
487 |
}
|
488 |
|
489 |
// μ¬μ΄λλ° 'Real-time Detections' μ
λ°μ΄νΈ
|
490 |
updateDetections() {
|
491 |
const detections = document.getElementById('detections');
|
492 |
-
|
493 |
-
|
|
|
494 |
<div class="detection">
|
495 |
-
${
|
496 |
-
${
|
497 |
-
${
|
498 |
-
${
|
499 |
-
|
500 |
-
? `${target.altitude.toFixed(0)}ft `
|
501 |
-
: ''
|
502 |
-
}
|
503 |
-
Signal: ${(target.signalStrength * 100).toFixed(0)}%
|
504 |
</div>
|
505 |
-
|
|
|
|
|
506 |
}
|
507 |
|
508 |
-
// μμ κΈ°
|
509 |
updateSignalStrengths() {
|
510 |
-
sdrStations.forEach(
|
511 |
-
const bar = document.querySelector(`#rx-${
|
512 |
if (bar) {
|
513 |
-
|
514 |
-
const strength = 40 + Math.random() * 60;
|
515 |
bar.style.width = `${strength}%`;
|
516 |
}
|
517 |
});
|
518 |
}
|
519 |
|
520 |
-
//
|
521 |
startTracking() {
|
|
|
522 |
setInterval(() => {
|
523 |
-
|
524 |
-
|
525 |
-
this.targets.add(this.generateTarget());
|
526 |
}
|
527 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
528 |
if (Math.random() < 0.1 && this.targets.size > 0) {
|
529 |
-
|
530 |
-
this.targets.delete(
|
|
|
531 |
}
|
532 |
|
533 |
-
//
|
534 |
-
this.
|
|
|
|
|
|
|
|
|
535 |
this.updateDetections();
|
536 |
this.updateSignalStrengths();
|
537 |
-
}, 100);
|
538 |
}
|
539 |
}
|
540 |
|
541 |
-
// νμ΄μ§ λ‘λ
|
542 |
window.addEventListener('load', () => {
|
543 |
-
|
544 |
});
|
545 |
</script>
|
546 |
</body>
|
|
|
2 |
<html>
|
3 |
<head>
|
4 |
<meta charset="UTF-8">
|
5 |
+
<title>Hyperscan: Global SDR Radar(Simul)</title>
|
|
|
|
|
6 |
<style>
|
7 |
+
/* μ 체 λ°°κ²½ λ° κΈ°λ³Έ μ€νμΌ */
|
8 |
body {
|
9 |
margin: 0;
|
10 |
padding: 20px;
|
|
|
24 |
border-radius: 8px;
|
25 |
height: calc(100vh - 40px);
|
26 |
overflow-y: auto;
|
|
|
27 |
}
|
28 |
#map {
|
|
|
|
|
29 |
background: #111;
|
30 |
+
border-radius: 8px;
|
31 |
+
height: calc(100vh - 40px);
|
32 |
}
|
33 |
|
34 |
+
/* μμ κΈ°(Receivers) λͺ©λ‘ μμ */
|
35 |
.receiver {
|
36 |
margin: 10px 0;
|
37 |
padding: 10px;
|
|
|
76 |
transition: width 0.3s;
|
77 |
}
|
78 |
|
79 |
+
/* νμ§(Detections) λͺ©λ‘ */
|
80 |
.detection {
|
81 |
padding: 5px;
|
82 |
margin: 5px 0;
|
|
|
84 |
border-left: 2px solid #0f0;
|
85 |
}
|
86 |
|
87 |
+
/* μ΄λ²€νΈ λ‘κ·Έ μΆλ ₯ */
|
88 |
+
.alert {
|
89 |
+
background: #911;
|
90 |
+
padding: 5px;
|
91 |
+
margin: 5px 0;
|
92 |
+
border-left: 2px solid #f00;
|
93 |
+
color: #f66;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
94 |
}
|
95 |
</style>
|
96 |
</head>
|
|
|
98 |
<div class="container">
|
99 |
<!-- μ¬μ΄λλ° -->
|
100 |
<div class="sidebar">
|
101 |
+
<h2>Hyperscan: Global SDR Radar(Simul)</h2>
|
102 |
+
|
103 |
+
<h3>SDR Receivers</h3>
|
104 |
<div id="receivers"></div>
|
105 |
|
106 |
<h3>Real-time Detections</h3>
|
107 |
<div id="detections"></div>
|
108 |
+
|
109 |
+
<h3>Events</h3>
|
110 |
+
<div id="events"></div>
|
111 |
</div>
|
112 |
|
113 |
+
<!-- μΊλ²μ€ μ§λ μμ -->
|
114 |
+
<canvas id="map"></canvas>
|
115 |
</div>
|
116 |
|
|
|
|
|
117 |
<script>
|
118 |
+
// μμ SDR μ€ν
μ΄μ
: μνλ λ§νΌ μΆκ°/μμ κ°λ₯
|
119 |
const sdrStations = [
|
|
|
120 |
{
|
121 |
name: "Twente WebSDR",
|
122 |
url: "websdr.ewi.utwente.nl:8901",
|
|
|
125 |
range: 200,
|
126 |
active: true
|
127 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
128 |
{
|
129 |
name: "KiwiSDR Switzerland",
|
130 |
url: "hb9ryz.no-ip.org:8073",
|
|
|
133 |
range: 160,
|
134 |
active: true
|
135 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
136 |
{
|
137 |
+
name: "SUWS WebSDR UK",
|
138 |
+
url: "websdr.suws.org.uk",
|
139 |
+
location: [51.2785, -0.7642],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
140 |
frequency: "0-30 MHz",
|
141 |
range: 150,
|
142 |
active: true
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
143 |
}
|
144 |
];
|
145 |
|
|
|
146 |
class RadarSystem {
|
147 |
constructor() {
|
148 |
+
// Canvas μ€λΉ
|
149 |
+
this.canvas = document.getElementById('map');
|
150 |
+
this.ctx = this.canvas.getContext('2d');
|
151 |
+
|
152 |
+
// νκ² μ 보 μ μ₯ (SetμΌλ‘ κ΄λ¦¬)
|
153 |
this.targets = new Set();
|
|
|
|
|
|
|
154 |
|
155 |
+
// νκ²μ μ΄λ κΆ€μ (trail)μ μ μ₯ (key: νκ²ID, value: {x,y} λ°°μ΄)
|
156 |
+
this.trails = new Map();
|
157 |
+
|
158 |
+
// μ΄λ²€νΈ λ‘κ·Έ
|
159 |
+
this.eventsLog = [];
|
160 |
+
|
161 |
+
// νν/κ΅λ μ΄λ²€νΈ μν
|
162 |
+
this.stormActive = false; // νν ν κΈ
|
163 |
+
this.stormCenter = { lat: 50.5, lon: 5.0 }; // νν μ€μ¬
|
164 |
+
this.stormRadius = 200; // νν λ°κ²½ (km)
|
165 |
+
|
166 |
+
this.setupCanvas();
|
167 |
this.renderReceivers();
|
168 |
this.startTracking();
|
169 |
}
|
170 |
|
171 |
+
// μΊλ²μ€ ν¬κΈ° λ§μΆκΈ°
|
172 |
+
setupCanvas() {
|
173 |
+
this.canvas.width = this.canvas.offsetWidth;
|
174 |
+
this.canvas.height = this.canvas.offsetHeight;
|
175 |
+
window.addEventListener('resize', () => {
|
176 |
+
this.canvas.width = this.canvas.offsetWidth;
|
177 |
+
this.canvas.height = this.canvas.offsetHeight;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
178 |
});
|
179 |
}
|
180 |
|
181 |
+
// μ¬μ΄λλ°μ μμ κΈ° 리μ€νΈ λ λλ§
|
182 |
renderReceivers() {
|
183 |
const container = document.getElementById('receivers');
|
184 |
+
container.innerHTML = sdrStations.map(st => `
|
185 |
+
<div class="receiver" id="rx-${st.url.split(':')[0]}">
|
186 |
<div class="status">
|
187 |
+
<div class="led ${st.active ? 'active' : 'inactive'}"></div>
|
188 |
+
<strong>${st.name}</strong>
|
189 |
</div>
|
190 |
+
<div>π‘ ${st.url}</div>
|
191 |
+
<div>π» ${st.frequency}</div>
|
192 |
+
<div>π ${st.location.join(', ')}</div>
|
193 |
+
<div>Range: ${st.range}km</div>
|
194 |
<div class="signal-strength">
|
195 |
<div class="signal-bar"></div>
|
196 |
</div>
|
|
|
198 |
`).join('');
|
199 |
}
|
200 |
|
201 |
+
// μμλ‘ νκ² νλ μμ±
|
|
|
202 |
generateTarget() {
|
203 |
+
const lat = 51.5 + (Math.random()-0.5)*4; // μμ λ²μ
|
204 |
+
const lon = 5.0 + (Math.random()-0.5)*8;
|
|
|
|
|
205 |
return {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
206 |
id: Math.random().toString(36).substr(2, 6).toUpperCase(),
|
207 |
+
type: Math.random() > 0.7 ? 'aircraft' : 'vehicle', // 30%νλ₯ aircraft
|
208 |
+
lat,
|
209 |
+
lon,
|
210 |
+
speed: (Math.random()*200 + 100).toFixed(0),
|
211 |
+
altitude: (Math.random()*30000 + 1000).toFixed(0),
|
212 |
+
heading: Math.random()*360,
|
213 |
signalStrength: Math.random()
|
214 |
};
|
215 |
}
|
216 |
|
217 |
+
// νκ² μ΄λ(heading, speed κΈ°λ°)
|
218 |
+
moveTarget(target) {
|
219 |
+
const speedKnots = parseFloat(target.speed);
|
220 |
+
// 1 knot μ½ 0.0005 deg/sec κ°μ (λ¨μν)
|
221 |
+
const speedFactor = 0.00005;
|
222 |
+
const rad = (target.heading * Math.PI) / 180;
|
223 |
+
// λΆ(μλ+), λ¨(μλ-), λ(κ²½λ+), μ(κ²½λ-)
|
224 |
+
target.lat += Math.cos(rad) * speedKnots * speedFactor;
|
225 |
+
target.lon += Math.sin(rad) * speedKnots * speedFactor;
|
226 |
+
}
|
227 |
+
|
228 |
+
// νν On/Off
|
229 |
+
toggleStorm() {
|
230 |
+
this.stormActive = !this.stormActive;
|
231 |
+
const msg = this.stormActive
|
232 |
+
? "νν λ°μ! μμ κ΅λ μ°λ €"
|
233 |
+
: "νν μλ©Έ. μν μ μν";
|
234 |
+
this.addEventLog(msg);
|
235 |
+
}
|
236 |
+
|
237 |
+
// λ‘κ·Έ μΆκ°
|
238 |
+
addEventLog(msg) {
|
239 |
+
this.eventsLog.push(msg);
|
240 |
+
const eventsDiv = document.getElementById('events');
|
241 |
+
// μΆκ°
|
242 |
+
eventsDiv.innerHTML += `<div class="alert">${msg}</div>`;
|
243 |
+
// λ무 λ§μμ§λ©΄ μ€λλ κΈ°λ‘ μ κ±°
|
244 |
+
if (this.eventsLog.length > 10) {
|
245 |
+
this.eventsLog.shift();
|
246 |
+
eventsDiv.removeChild(eventsDiv.firstChild);
|
247 |
+
}
|
248 |
+
}
|
249 |
+
|
250 |
+
// μλκ²½λλ₯Ό μΊλ²μ€ μ’νλ‘ λ³ν (λ¨μλ)
|
251 |
+
latLongToXY(lat, lon) {
|
252 |
+
const centerLat = 51.5;
|
253 |
+
const centerLon = 5.0;
|
254 |
+
const scale = 100;
|
255 |
+
const x = (lon - centerLon) * scale + this.canvas.width / 2;
|
256 |
+
const y = (centerLat - lat) * scale + this.canvas.height / 2;
|
257 |
+
return { x, y };
|
258 |
+
}
|
259 |
+
|
260 |
+
// λ μ (μλκ²½λ) μ¬μ΄ 거리(km)
|
261 |
+
distanceKm(lat1, lon1, lat2, lon2) {
|
262 |
+
const R = 6371;
|
263 |
+
const dLat = (lat2 - lat1) * Math.PI/180;
|
264 |
+
const dLon = (lon2 - lon1) * Math.PI/180;
|
265 |
+
const a = Math.sin(dLat/2)*Math.sin(dLat/2)
|
266 |
+
+ Math.cos(lat1*Math.PI/180)*Math.cos(lat2*Math.PI/180)
|
267 |
+
* Math.sin(dLon/2)*Math.sin(dLon/2);
|
268 |
+
return R * 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));
|
269 |
+
}
|
270 |
+
|
271 |
+
// λ°°κ²½+그리λ 그리기
|
272 |
+
drawBackground() {
|
273 |
+
this.ctx.fillStyle = '#111';
|
274 |
+
this.ctx.fillRect(0, 0, this.canvas.width, this.canvas.height);
|
275 |
+
|
276 |
+
this.ctx.strokeStyle = '#1a1a1a';
|
277 |
+
this.ctx.lineWidth = 1;
|
278 |
+
// μΈλ‘ 그리λ
|
279 |
+
for (let i=0; i<this.canvas.width; i+=50) {
|
280 |
+
this.ctx.beginPath();
|
281 |
+
this.ctx.moveTo(i, 0);
|
282 |
+
this.ctx.lineTo(i, this.canvas.height);
|
283 |
+
this.ctx.stroke();
|
284 |
+
}
|
285 |
+
// κ°λ‘ 그리λ
|
286 |
+
for (let i=0; i<this.canvas.height; i+=50) {
|
287 |
+
this.ctx.beginPath();
|
288 |
+
this.ctx.moveTo(0, i);
|
289 |
+
this.ctx.lineTo(this.canvas.width, i);
|
290 |
+
this.ctx.stroke();
|
291 |
+
}
|
292 |
+
}
|
293 |
|
294 |
+
// μ€ν
μ΄μ
+ νν νμ
|
295 |
+
drawStations() {
|
296 |
+
// νν λ²μ μκ°ν
|
297 |
+
if (this.stormActive) {
|
298 |
+
const sc = this.latLongToXY(this.stormCenter.lat, this.stormCenter.lon);
|
299 |
+
this.ctx.beginPath();
|
300 |
+
this.ctx.arc(sc.x, sc.y, this.stormRadius, 0, Math.PI*2);
|
301 |
+
this.ctx.fillStyle = 'rgba(255,0,0,0.1)';
|
302 |
+
this.ctx.fill();
|
303 |
+
this.ctx.strokeStyle = 'rgba(255,0,0,0.5)';
|
304 |
+
this.ctx.stroke();
|
305 |
+
}
|
306 |
+
|
307 |
+
// μμ κΈ° μ€ν
μ΄μ
|
308 |
+
sdrStations.forEach(st => {
|
309 |
+
const pos = this.latLongToXY(st.location[0], st.location[1]);
|
310 |
+
// λ²μ μ
|
311 |
+
this.ctx.beginPath();
|
312 |
+
this.ctx.arc(pos.x, pos.y, st.range, 0, Math.PI*2);
|
313 |
+
this.ctx.strokeStyle = st.active
|
314 |
+
? 'rgba(0,255,0,0.2)'
|
315 |
+
: 'rgba(255,0,0,0.2)';
|
316 |
+
this.ctx.stroke();
|
317 |
+
|
318 |
+
// μ€μ¬ μ
|
319 |
+
this.ctx.beginPath();
|
320 |
+
this.ctx.arc(pos.x, pos.y, 4, 0, Math.PI*2);
|
321 |
+
this.ctx.fillStyle = st.active ? '#0f0' : '#f00';
|
322 |
+
this.ctx.fill();
|
323 |
+
|
324 |
+
// λΌλ²¨
|
325 |
+
this.ctx.fillStyle = '#0f0';
|
326 |
+
this.ctx.font = '10px monospace';
|
327 |
+
this.ctx.fillText(st.name, pos.x+8, pos.y+4);
|
328 |
+
});
|
329 |
+
}
|
330 |
|
331 |
+
// νκ² λ° κΆ€μ 그리기
|
332 |
+
drawTargets() {
|
333 |
this.targets.forEach(target => {
|
334 |
+
// νκ² μ΄λ
|
335 |
+
this.moveTarget(target);
|
336 |
+
|
337 |
+
// νν μν₯: λ²μ λ΄μ μμΌλ©΄ μ νΈκ°λ κ°μ
|
338 |
+
if (this.stormActive) {
|
339 |
+
const distStorm = this.distanceKm(
|
340 |
+
target.lat, target.lon,
|
341 |
+
this.stormCenter.lat, this.stormCenter.lon
|
342 |
+
);
|
343 |
+
if (distStorm <= this.stormRadius) {
|
344 |
+
target.signalStrength = Math.max(0, target.signalStrength - 0.01);
|
|
|
|
|
|
|
|
|
|
|
|
|
345 |
}
|
346 |
+
}
|
347 |
+
|
348 |
+
// νκ² μμΉ
|
349 |
+
const pos = this.latLongToXY(target.lat, target.lon);
|
350 |
+
|
351 |
+
// κΆ€μ μ μ₯
|
352 |
+
if (!this.trails.has(target.id)) {
|
353 |
+
this.trails.set(target.id, []);
|
354 |
+
}
|
355 |
+
const trail = this.trails.get(target.id);
|
356 |
+
trail.push({x: pos.x, y: pos.y});
|
357 |
+
if (trail.length > 100) {
|
358 |
+
trail.shift(); // μ€λλ μ’ν μ κ±°
|
359 |
+
}
|
360 |
+
|
361 |
+
// μ€ν
μ΄μ
μ°κ²°μ
|
362 |
+
sdrStations.forEach(st => {
|
363 |
+
if (st.active) {
|
364 |
+
const dist = this.distanceKm(
|
365 |
+
target.lat, target.lon,
|
366 |
+
st.location[0], st.location[1]
|
367 |
+
);
|
368 |
+
if (dist <= st.range) {
|
369 |
+
const sp = this.latLongToXY(st.location[0], st.location[1]);
|
370 |
+
this.ctx.beginPath();
|
371 |
+
this.ctx.moveTo(sp.x, sp.y);
|
372 |
+
this.ctx.lineTo(pos.x, pos.y);
|
373 |
+
this.ctx.strokeStyle = `rgba(0,255,0,${target.signalStrength*0.3})`;
|
374 |
+
this.ctx.stroke();
|
375 |
}
|
376 |
}
|
377 |
});
|
378 |
+
|
379 |
+
// νκ² κΆ€μ
|
380 |
+
this.ctx.beginPath();
|
381 |
+
this.ctx.strokeStyle = (target.type==='aircraft')
|
382 |
+
? 'rgba(255,255,0,0.3)'
|
383 |
+
: 'rgba(0,255,255,0.3)';
|
384 |
+
for (let i=0; i<trail.length-1; i++) {
|
385 |
+
this.ctx.moveTo(trail[i].x, trail[i].y);
|
386 |
+
this.ctx.lineTo(trail[i+1].x, trail[i+1].y);
|
387 |
+
}
|
388 |
+
this.ctx.stroke();
|
389 |
+
|
390 |
+
// νμ¬ νκ² μ
|
391 |
+
this.ctx.beginPath();
|
392 |
+
this.ctx.arc(pos.x, pos.y, 3, 0, Math.PI*2);
|
393 |
+
this.ctx.fillStyle = (target.type==='aircraft') ? '#ff0' : '#0ff';
|
394 |
+
this.ctx.fill();
|
395 |
+
|
396 |
+
// μλ³ μ 보
|
397 |
+
this.ctx.fillStyle = '#666';
|
398 |
+
this.ctx.font = '10px monospace';
|
399 |
+
this.ctx.fillText(`${target.id} (${target.type})`, pos.x+8, pos.y+4);
|
400 |
});
|
401 |
}
|
402 |
|
403 |
// μ¬μ΄λλ° 'Real-time Detections' μ
λ°μ΄νΈ
|
404 |
updateDetections() {
|
405 |
const detections = document.getElementById('detections');
|
406 |
+
let html = '';
|
407 |
+
this.targets.forEach(t => {
|
408 |
+
html += `
|
409 |
<div class="detection">
|
410 |
+
${t.type==='aircraft' ? 'βοΈ' : 'π'}
|
411 |
+
${t.id}
|
412 |
+
Speed: ${t.speed}kts
|
413 |
+
${t.type==='aircraft' ? 'Alt: '+t.altitude+'ft' : ''}
|
414 |
+
Sig: ${(t.signalStrength*100).toFixed(0)}%
|
|
|
|
|
|
|
|
|
415 |
</div>
|
416 |
+
`;
|
417 |
+
});
|
418 |
+
detections.innerHTML = html;
|
419 |
}
|
420 |
|
421 |
+
// μμ κΈ° μ νΈκ°λ λ° λ¬΄μμ μ
λ°μ΄νΈ
|
422 |
updateSignalStrengths() {
|
423 |
+
sdrStations.forEach(st => {
|
424 |
+
const bar = document.querySelector(`#rx-${st.url.split(':')[0]} .signal-bar`);
|
425 |
if (bar) {
|
426 |
+
const strength = 40 + Math.random()*60;
|
|
|
427 |
bar.style.width = `${strength}%`;
|
428 |
}
|
429 |
});
|
430 |
}
|
431 |
|
432 |
+
// λ©μΈ 루ν
|
433 |
startTracking() {
|
434 |
+
// νν ν κΈ(μ½ 20% νλ₯ λ‘ 10μ΄λ§λ€ ν λ² λ°μ)
|
435 |
setInterval(() => {
|
436 |
+
if (Math.random() < 0.2) {
|
437 |
+
this.toggleStorm();
|
|
|
438 |
}
|
439 |
+
}, 10000);
|
440 |
+
|
441 |
+
// 100msλ§λ€ κ°±μ
|
442 |
+
setInterval(() => {
|
443 |
+
// 10% νλ₯ λ‘ νκ² μΆκ°
|
444 |
+
if (Math.random() < 0.1 && this.targets.size < 15) {
|
445 |
+
const newT = this.generateTarget();
|
446 |
+
this.targets.add(newT);
|
447 |
+
this.addEventLog(`μ νκ² μΆν: ${newT.id}`);
|
448 |
+
}
|
449 |
+
// 10% νλ₯ λ‘ νκ² νλ μ κ±°
|
450 |
if (Math.random() < 0.1 && this.targets.size > 0) {
|
451 |
+
const first = Array.from(this.targets)[0];
|
452 |
+
this.targets.delete(first);
|
453 |
+
this.addEventLog(`νκ² μλ©Έ: ${first.id}`);
|
454 |
}
|
455 |
|
456 |
+
// 맀 νλ μ νλ©΄ 그리기
|
457 |
+
this.drawBackground();
|
458 |
+
this.drawStations();
|
459 |
+
this.drawTargets();
|
460 |
+
|
461 |
+
// μ¬μ΄λλ° κ°±μ
|
462 |
this.updateDetections();
|
463 |
this.updateSignalStrengths();
|
464 |
+
}, 100);
|
465 |
}
|
466 |
}
|
467 |
|
468 |
+
// νμ΄μ§ λ‘λ μ μμ
|
469 |
window.addEventListener('load', () => {
|
470 |
+
new RadarSystem();
|
471 |
});
|
472 |
</script>
|
473 |
</body>
|