File size: 17,700 Bytes
a817a6f 1e56734 a817a6f 1e56734 a817a6f 72f1549 a817a6f 3cfdd58 a817a6f 3cfdd58 1e56734 3cfdd58 a817a6f 1e56734 a817a6f 72f1549 a817a6f 72f1549 a817a6f 72f1549 4808b10 3cfdd58 72f1549 1e56734 72f1549 3cfdd58 72f1549 3eaa1f4 3cfdd58 fd6d094 1e56734 ab7c1ca a817a6f 3cfdd58 a817a6f 1e56734 a817a6f 72f1549 1e56734 a817a6f 72f1549 1e56734 a817a6f 1e56734 72f1549 a817a6f 72f1549 a817a6f 72f1549 e167ec4 a817a6f 80347b4 1e56734 3cfdd58 30411f7 3cfdd58 1e56734 3cfdd58 1e56734 3cfdd58 30411f7 1e56734 3cfdd58 30411f7 1e56734 3cfdd58 1e56734 3cfdd58 1e56734 3cfdd58 1e56734 3cfdd58 30411f7 1e56734 3cfdd58 1e56734 3cfdd58 1e56734 3cfdd58 30411f7 5921982 1e56734 3cfdd58 1e56734 3cfdd58 1e56734 3cfdd58 1e56734 3cfdd58 1e56734 3cfdd58 1e56734 3cfdd58 5921982 3cfdd58 1e56734 3cfdd58 1e56734 3cfdd58 1e56734 3cfdd58 5921982 1e56734 3cfdd58 1e56734 3cfdd58 1e56734 3cfdd58 30411f7 1e56734 30411f7 1e56734 30411f7 1e56734 3cfdd58 1e56734 3cfdd58 1e56734 3cfdd58 1e56734 3cfdd58 1e56734 30411f7 1e56734 30411f7 1e56734 30411f7 3cfdd58 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 |
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hyperscan: Global SDR Radar(Simul)</title>
<style>
/* μ 체 λ°°κ²½ λ° κΈ°λ³Έ μ€νμΌ */
body {
margin: 0;
padding: 20px;
background: #000;
color: #0f0;
font-family: monospace;
overflow: hidden;
}
.container {
display: grid;
grid-template-columns: 300px 1fr;
gap: 20px;
}
.sidebar {
background: #111;
padding: 15px;
border-radius: 8px;
height: calc(100vh - 40px);
overflow-y: auto;
}
#map {
background: #111;
border-radius: 8px;
height: calc(100vh - 40px);
}
/* μμ κΈ°(Receivers) λͺ©λ‘ μμ */
.receiver {
margin: 10px 0;
padding: 10px;
background: #1a1a1a;
border-radius: 4px;
position: relative;
}
.status {
display: flex;
align-items: center;
margin-bottom: 5px;
}
.led {
width: 8px;
height: 8px;
border-radius: 50%;
margin-right: 8px;
}
.active {
background: #0f0;
box-shadow: 0 0 10px #0f0;
animation: pulse 2s infinite;
}
@keyframes pulse {
0% { opacity: 1; }
50% { opacity: 0.5; }
100% { opacity: 1; }
}
.inactive {
background: #f00;
}
.signal-strength {
height: 4px;
background: #222;
margin-top: 5px;
border-radius: 2px;
}
.signal-bar {
height: 100%;
background: #0f0;
width: 50%;
transition: width 0.3s;
}
/* νμ§(Detections) λͺ©λ‘ */
.detection {
padding: 5px;
margin: 5px 0;
font-size: 12px;
border-left: 2px solid #0f0;
}
/* μ΄λ²€νΈ λ‘κ·Έ μΆλ ₯ */
.alert {
background: #911;
padding: 5px;
margin: 5px 0;
border-left: 2px solid #f00;
color: #f66;
}
</style>
</head>
<body>
<div class="container">
<!-- μ¬μ΄λλ° -->
<div class="sidebar">
<h2>Hyperscan: Global SDR Radar(Simul)</h2>
<h3>SDR Receivers</h3>
<div id="receivers"></div>
<h3>Real-time Detections</h3>
<div id="detections"></div>
<h3>Events</h3>
<div id="events"></div>
</div>
<!-- μΊλ²μ€ μ§λ μμ -->
<canvas id="map"></canvas>
</div>
<script>
// μμ SDR μ€ν
μ΄μ
: μνλ λ§νΌ μΆκ°/μμ κ°λ₯
const sdrStations = [
{
name: "Twente WebSDR",
url: "websdr.ewi.utwente.nl:8901",
location: [52.2389, 6.8343],
frequency: "0-29.160 MHz",
range: 200,
active: true
},
{
name: "KiwiSDR Switzerland",
url: "hb9ryz.no-ip.org:8073",
location: [47.3769, 8.5417],
frequency: "0-30 MHz",
range: 160,
active: true
},
{
name: "SUWS WebSDR UK",
url: "websdr.suws.org.uk",
location: [51.2785, -0.7642],
frequency: "0-30 MHz",
range: 150,
active: true
}
];
class RadarSystem {
constructor() {
// Canvas μ€λΉ
this.canvas = document.getElementById('map');
this.ctx = this.canvas.getContext('2d');
// νκ² μ 보 μ μ₯ (SetμΌλ‘ κ΄λ¦¬)
this.targets = new Set();
// νκ²μ μ΄λ κΆ€μ (trail)μ μ μ₯ (key: νκ²ID, value: {x,y} λ°°μ΄)
this.trails = new Map();
// μ΄λ²€νΈ λ‘κ·Έ
this.eventsLog = [];
// νν/κ΅λ μ΄λ²€νΈ μν
this.stormActive = false; // νν ν κΈ
this.stormCenter = { lat: 50.5, lon: 5.0 }; // νν μ€μ¬
this.stormRadius = 200; // νν λ°κ²½ (km)
this.setupCanvas();
this.renderReceivers();
this.startTracking();
}
// μΊλ²μ€ ν¬κΈ° λ§μΆκΈ°
setupCanvas() {
this.canvas.width = this.canvas.offsetWidth;
this.canvas.height = this.canvas.offsetHeight;
window.addEventListener('resize', () => {
this.canvas.width = this.canvas.offsetWidth;
this.canvas.height = this.canvas.offsetHeight;
});
}
// μ¬μ΄λλ°μ μμ κΈ° 리μ€νΈ λ λλ§
renderReceivers() {
const container = document.getElementById('receivers');
container.innerHTML = sdrStations.map(st => `
<div class="receiver" id="rx-${st.url.split(':')[0]}">
<div class="status">
<div class="led ${st.active ? 'active' : 'inactive'}"></div>
<strong>${st.name}</strong>
</div>
<div>π‘ ${st.url}</div>
<div>π» ${st.frequency}</div>
<div>π ${st.location.join(', ')}</div>
<div>Range: ${st.range}km</div>
<div class="signal-strength">
<div class="signal-bar"></div>
</div>
</div>
`).join('');
}
// μμλ‘ νκ² νλ μμ±
generateTarget() {
const lat = 51.5 + (Math.random()-0.5)*4; // μμ λ²μ
const lon = 5.0 + (Math.random()-0.5)*8;
return {
id: Math.random().toString(36).substr(2, 6).toUpperCase(),
type: Math.random() > 0.7 ? 'aircraft' : 'vehicle', // 30%νλ₯ aircraft
lat,
lon,
speed: (Math.random()*200 + 100).toFixed(0),
altitude: (Math.random()*30000 + 1000).toFixed(0),
heading: Math.random()*360,
signalStrength: Math.random()
};
}
// νκ² μ΄λ(heading, speed κΈ°λ°)
moveTarget(target) {
const speedKnots = parseFloat(target.speed);
// 1 knot μ½ 0.0005 deg/sec κ°μ (λ¨μν)
const speedFactor = 0.00005;
const rad = (target.heading * Math.PI) / 180;
// λΆ(μλ+), λ¨(μλ-), λ(κ²½λ+), μ(κ²½λ-)
target.lat += Math.cos(rad) * speedKnots * speedFactor;
target.lon += Math.sin(rad) * speedKnots * speedFactor;
}
// νν On/Off
toggleStorm() {
this.stormActive = !this.stormActive;
const msg = this.stormActive
? "νν λ°μ! μμ κ΅λ μ°λ €"
: "νν μλ©Έ. μν μ μν";
this.addEventLog(msg);
}
// λ‘κ·Έ μΆκ°
addEventLog(msg) {
this.eventsLog.push(msg);
const eventsDiv = document.getElementById('events');
// μΆκ°
eventsDiv.innerHTML += `<div class="alert">${msg}</div>`;
// λ무 λ§μμ§λ©΄ μ€λλ κΈ°λ‘ μ κ±°
if (this.eventsLog.length > 10) {
this.eventsLog.shift();
eventsDiv.removeChild(eventsDiv.firstChild);
}
}
// μλκ²½λλ₯Ό μΊλ²μ€ μ’νλ‘ λ³ν (λ¨μλ)
latLongToXY(lat, lon) {
const centerLat = 51.5;
const centerLon = 5.0;
const scale = 100;
const x = (lon - centerLon) * scale + this.canvas.width / 2;
const y = (centerLat - lat) * scale + this.canvas.height / 2;
return { x, y };
}
// λ μ (μλκ²½λ) μ¬μ΄ 거리(km)
distanceKm(lat1, lon1, lat2, lon2) {
const R = 6371;
const dLat = (lat2 - lat1) * Math.PI/180;
const dLon = (lon2 - lon1) * Math.PI/180;
const a = Math.sin(dLat/2)*Math.sin(dLat/2)
+ Math.cos(lat1*Math.PI/180)*Math.cos(lat2*Math.PI/180)
* Math.sin(dLon/2)*Math.sin(dLon/2);
return R * 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));
}
// λ°°κ²½+그리λ 그리기
drawBackground() {
this.ctx.fillStyle = '#111';
this.ctx.fillRect(0, 0, this.canvas.width, this.canvas.height);
this.ctx.strokeStyle = '#1a1a1a';
this.ctx.lineWidth = 1;
// μΈλ‘ 그리λ
for (let i=0; i<this.canvas.width; i+=50) {
this.ctx.beginPath();
this.ctx.moveTo(i, 0);
this.ctx.lineTo(i, this.canvas.height);
this.ctx.stroke();
}
// κ°λ‘ 그리λ
for (let i=0; i<this.canvas.height; i+=50) {
this.ctx.beginPath();
this.ctx.moveTo(0, i);
this.ctx.lineTo(this.canvas.width, i);
this.ctx.stroke();
}
}
// μ€ν
μ΄μ
+ νν νμ
drawStations() {
// νν λ²μ μκ°ν
if (this.stormActive) {
const sc = this.latLongToXY(this.stormCenter.lat, this.stormCenter.lon);
this.ctx.beginPath();
this.ctx.arc(sc.x, sc.y, this.stormRadius, 0, Math.PI*2);
this.ctx.fillStyle = 'rgba(255,0,0,0.1)';
this.ctx.fill();
this.ctx.strokeStyle = 'rgba(255,0,0,0.5)';
this.ctx.stroke();
}
// μμ κΈ° μ€ν
μ΄μ
sdrStations.forEach(st => {
const pos = this.latLongToXY(st.location[0], st.location[1]);
// λ²μ μ
this.ctx.beginPath();
this.ctx.arc(pos.x, pos.y, st.range, 0, Math.PI*2);
this.ctx.strokeStyle = st.active
? 'rgba(0,255,0,0.2)'
: 'rgba(255,0,0,0.2)';
this.ctx.stroke();
// μ€μ¬ μ
this.ctx.beginPath();
this.ctx.arc(pos.x, pos.y, 4, 0, Math.PI*2);
this.ctx.fillStyle = st.active ? '#0f0' : '#f00';
this.ctx.fill();
// λΌλ²¨
this.ctx.fillStyle = '#0f0';
this.ctx.font = '10px monospace';
this.ctx.fillText(st.name, pos.x+8, pos.y+4);
});
}
// νκ² λ° κΆ€μ 그리기
drawTargets() {
this.targets.forEach(target => {
// νκ² μ΄λ
this.moveTarget(target);
// νν μν₯: λ²μ λ΄μ μμΌλ©΄ μ νΈκ°λ κ°μ
if (this.stormActive) {
const distStorm = this.distanceKm(
target.lat, target.lon,
this.stormCenter.lat, this.stormCenter.lon
);
if (distStorm <= this.stormRadius) {
target.signalStrength = Math.max(0, target.signalStrength - 0.01);
}
}
// νκ² μμΉ
const pos = this.latLongToXY(target.lat, target.lon);
// κΆ€μ μ μ₯
if (!this.trails.has(target.id)) {
this.trails.set(target.id, []);
}
const trail = this.trails.get(target.id);
trail.push({x: pos.x, y: pos.y});
if (trail.length > 100) {
trail.shift(); // μ€λλ μ’ν μ κ±°
}
// μ€ν
μ΄μ
μ°κ²°μ
sdrStations.forEach(st => {
if (st.active) {
const dist = this.distanceKm(
target.lat, target.lon,
st.location[0], st.location[1]
);
if (dist <= st.range) {
const sp = this.latLongToXY(st.location[0], st.location[1]);
this.ctx.beginPath();
this.ctx.moveTo(sp.x, sp.y);
this.ctx.lineTo(pos.x, pos.y);
this.ctx.strokeStyle = `rgba(0,255,0,${target.signalStrength*0.3})`;
this.ctx.stroke();
}
}
});
// νκ² κΆ€μ
this.ctx.beginPath();
this.ctx.strokeStyle = (target.type==='aircraft')
? 'rgba(255,255,0,0.3)'
: 'rgba(0,255,255,0.3)';
for (let i=0; i<trail.length-1; i++) {
this.ctx.moveTo(trail[i].x, trail[i].y);
this.ctx.lineTo(trail[i+1].x, trail[i+1].y);
}
this.ctx.stroke();
// νμ¬ νκ² μ
this.ctx.beginPath();
this.ctx.arc(pos.x, pos.y, 3, 0, Math.PI*2);
this.ctx.fillStyle = (target.type==='aircraft') ? '#ff0' : '#0ff';
this.ctx.fill();
// μλ³ μ 보
this.ctx.fillStyle = '#666';
this.ctx.font = '10px monospace';
this.ctx.fillText(`${target.id} (${target.type})`, pos.x+8, pos.y+4);
});
}
// μ¬μ΄λλ° 'Real-time Detections' μ
λ°μ΄νΈ
updateDetections() {
const detections = document.getElementById('detections');
let html = '';
this.targets.forEach(t => {
html += `
<div class="detection">
${t.type==='aircraft' ? 'βοΈ' : 'π'}
${t.id}
Speed: ${t.speed}kts
${t.type==='aircraft' ? 'Alt: '+t.altitude+'ft' : ''}
Sig: ${(t.signalStrength*100).toFixed(0)}%
</div>
`;
});
detections.innerHTML = html;
}
// μμ κΈ° μ νΈκ°λ λ° λ¬΄μμ μ
λ°μ΄νΈ
updateSignalStrengths() {
sdrStations.forEach(st => {
const bar = document.querySelector(`#rx-${st.url.split(':')[0]} .signal-bar`);
if (bar) {
const strength = 40 + Math.random()*60;
bar.style.width = `${strength}%`;
}
});
}
// λ©μΈ 루ν
startTracking() {
// νν ν κΈ(μ½ 20% νλ₯ λ‘ 10μ΄λ§λ€ ν λ² λ°μ)
setInterval(() => {
if (Math.random() < 0.2) {
this.toggleStorm();
}
}, 10000);
// 100msλ§λ€ κ°±μ
setInterval(() => {
// 10% νλ₯ λ‘ νκ² μΆκ°
if (Math.random() < 0.1 && this.targets.size < 15) {
const newT = this.generateTarget();
this.targets.add(newT);
this.addEventLog(`μ νκ² μΆν: ${newT.id}`);
}
// 10% νλ₯ λ‘ νκ² νλ μ κ±°
if (Math.random() < 0.1 && this.targets.size > 0) {
const first = Array.from(this.targets)[0];
this.targets.delete(first);
this.addEventLog(`νκ² μλ©Έ: ${first.id}`);
}
// 맀 νλ μ νλ©΄ 그리기
this.drawBackground();
this.drawStations();
this.drawTargets();
// μ¬μ΄λλ° κ°±μ
this.updateDetections();
this.updateSignalStrengths();
}, 100);
}
}
// νμ΄μ§ λ‘λ μ μμ
window.addEventListener('load', () => {
new RadarSystem();
});
</script>
</body>
</html>
|