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>
|