Update index.html
Browse files- index.html +74 -19
index.html
CHANGED
@@ -1,19 +1,74 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
updateDetections() {
|
2 |
+
const detections = document.getElementById('detections');
|
3 |
+
detections.innerHTML = Array.from(this.targets)
|
4 |
+
.map(target => `
|
5 |
+
<div class="detection">
|
6 |
+
${target.type === 'aircraft' ? 'โ๏ธ' : '๐'}
|
7 |
+
${target.id}
|
8 |
+
${target.speed.toFixed(0)}kts
|
9 |
+
${target.type === 'aircraft' ? `${target.altitude.toFixed(0)}ft` : ''}
|
10 |
+
Signal: ${(target.signalStrength * 100).toFixed(0)}%
|
11 |
+
Position: ${target.position.lat.toFixed(2)}ยฐ, ${target.position.lon.toFixed(2)}ยฐ
|
12 |
+
</div>
|
13 |
+
`).join('');
|
14 |
+
}
|
15 |
+
|
16 |
+
updateSignalStrengths() {
|
17 |
+
sdrStations.forEach(station => {
|
18 |
+
const bar = document.querySelector(`#rx-${station.url.split(':')[0]} .signal-bar`);
|
19 |
+
if(bar) {
|
20 |
+
const strength = 40 + Math.random() * 60;
|
21 |
+
bar.style.width = `${strength}%`;
|
22 |
+
}
|
23 |
+
});
|
24 |
+
}
|
25 |
+
|
26 |
+
startTracking() {
|
27 |
+
setInterval(() => {
|
28 |
+
// ํ๊ฒ ์ถ๊ฐ/์ ๊ฑฐ
|
29 |
+
if(Math.random() < 0.1 && this.targets.size < 15) {
|
30 |
+
this.targets.add(this.generateTarget());
|
31 |
+
}
|
32 |
+
if(Math.random() < 0.1 && this.targets.size > 0) {
|
33 |
+
this.targets.delete(Array.from(this.targets)[0]);
|
34 |
+
}
|
35 |
+
|
36 |
+
// ๊ธฐ์กด ํ๊ฒ ์
๋ฐ์ดํธ (์์ง์ ์๋ฎฌ๋ ์ด์
)
|
37 |
+
this.targets.forEach(target => {
|
38 |
+
// ํ์ฌ ๋ฐฉํฅ์ผ๋ก ์ด๋
|
39 |
+
const speed = target.speed / 3600; // kts to degrees per second (approximate)
|
40 |
+
const radians = target.heading * Math.PI / 180;
|
41 |
+
|
42 |
+
target.position.lon += Math.sin(radians) * speed;
|
43 |
+
target.position.lat += Math.cos(radians) * speed;
|
44 |
+
|
45 |
+
// ํ๋ฉด ๊ฒฝ๊ณ ์ฒ๋ฆฌ
|
46 |
+
if(target.position.lon > 180) target.position.lon -= 360;
|
47 |
+
if(target.position.lon < -180) target.position.lon += 360;
|
48 |
+
if(target.position.lat > 75) target.position.lat = 75;
|
49 |
+
if(target.position.lat < -75) target.position.lat = -75;
|
50 |
+
|
51 |
+
// ๊ฐ๋ ๋ฐฉํฅ ๋ณ๊ฒฝ
|
52 |
+
if(Math.random() < 0.05) {
|
53 |
+
target.heading += (Math.random() - 0.5) * 30;
|
54 |
+
target.heading = (target.heading + 360) % 360;
|
55 |
+
}
|
56 |
+
|
57 |
+
// ์ ํธ ๊ฐ๋ ๋ณ๋
|
58 |
+
target.signalStrength = Math.max(0.1, Math.min(1, target.signalStrength + (Math.random() - 0.5) * 0.1));
|
59 |
+
});
|
60 |
+
|
61 |
+
this.drawWorldMap();
|
62 |
+
this.drawStations();
|
63 |
+
this.drawTargets();
|
64 |
+
this.updateDetections();
|
65 |
+
this.updateSignalStrengths();
|
66 |
+
}, 100);
|
67 |
+
}
|
68 |
+
}
|
69 |
+
|
70 |
+
// Initialize global radar system
|
71 |
+
const radar = new GlobalRadarSystem();
|
72 |
+
</script>
|
73 |
+
</body>
|
74 |
+
</html>
|