File size: 6,061 Bytes
a817a6f e167ec4 a817a6f 4808b10 a817a6f 4808b10 a817a6f e167ec4 4808b10 a817a6f e167ec4 a817a6f 4808b10 a817a6f 4808b10 e167ec4 a817a6f e167ec4 a817a6f e167ec4 a817a6f e167ec4 a817a6f e167ec4 a817a6f e167ec4 a817a6f e167ec4 a817a6f e167ec4 4808b10 a817a6f e167ec4 4808b10 a817a6f e167ec4 a817a6f e167ec4 a817a6f e167ec4 a817a6f e167ec4 a817a6f e167ec4 a817a6f e167ec4 4808b10 a817a6f e167ec4 a817a6f e167ec4 4808b10 a817a6f e167ec4 a817a6f e167ec4 a817a6f e167ec4 4808b10 a817a6f e167ec4 a817a6f e167ec4 a817a6f e167ec4 a817a6f 0e4238b e167ec4 |
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 |
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Basic SDR Network Monitor</title>
<style>
body {
margin: 0;
padding: 20px;
background: #000;
color: #0f0;
font-family: monospace;
}
.container {
display: grid;
grid-template-columns: 300px 1fr;
gap: 20px;
height: calc(100vh - 40px);
}
.sidebar {
background: #111;
padding: 15px;
border-radius: 8px;
overflow-y: auto;
}
.map-container {
background: #111;
border-radius: 8px;
position: relative;
}
.receiver {
margin: 10px 0;
padding: 10px;
background: #1a1a1a;
border-radius: 4px;
}
.status {
display: flex;
align-items: center;
margin-bottom: 5px;
}
.led {
width: 8px;
height: 8px;
border-radius: 50%;
margin-right: 8px;
background: #0f0;
}
canvas {
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<div class="container">
<div class="sidebar">
<h3>SDR Receivers</h3>
<div id="receivers"></div>
</div>
<div class="map-container">
<canvas id="map"></canvas>
</div>
</div>
<script>
// SDR 스테이션 데이터
const stations = [
{
name: "Twente WebSDR",
location: [52.2389, 6.8343],
active: true
},
{
name: "TU Delft WebSDR",
location: [51.9981, 4.3731],
active: true
},
{
name: "W6YXP WebSDR",
location: [37.4275, -122.1697],
active: true
},
{
name: "Tokyo WebSDR",
location: [35.6762, 139.6503],
active: true
}
];
class SDRMonitor {
constructor() {
this.canvas = document.getElementById('map');
this.ctx = this.canvas.getContext('2d');
this.setupCanvas();
this.renderStations();
this.drawMap();
}
setupCanvas() {
// 캔버스 크기 설정
const updateSize = () => {
const container = this.canvas.parentElement;
this.canvas.width = container.offsetWidth;
this.canvas.height = container.offsetHeight;
};
updateSize();
window.addEventListener('resize', () => {
updateSize();
this.drawMap();
});
}
renderStations() {
const container = document.getElementById('receivers');
container.innerHTML = stations.map(station => `
<div class="receiver">
<div class="status">
<div class="led"></div>
<strong>${station.name}</strong>
</div>
<div>Location: ${station.location.join(', ')}</div>
</div>
`).join('');
}
latLongToXY(lat, lon) {
const mapWidth = this.canvas.width;
const mapHeight = this.canvas.height;
const x = (lon + 180) * (mapWidth / 360);
const latRad = lat * Math.PI / 180;
const mercN = Math.log(Math.tan((Math.PI / 4) + (latRad / 2)));
const y = (mapHeight / 2) - (mapWidth * mercN / (2 * Math.PI));
return {x, y};
}
drawMap() {
// 배경 그리기
this.ctx.fillStyle = '#111';
this.ctx.fillRect(0, 0, this.canvas.width, this.canvas.height);
// 그리드 그리기
this.ctx.strokeStyle = '#1a1a1a';
this.ctx.lineWidth = 1;
// 경도선 (30도 간격)
for(let lon = -180; lon <= 180; lon += 30) {
const start = this.latLongToXY(-80, lon);
const end = this.latLongToXY(80, lon);
this.ctx.beginPath();
this.ctx.moveTo(start.x, start.y);
this.ctx.lineTo(end.x, end.y);
this.ctx.stroke();
}
// 위도선 (20도 간격)
for(let lat = -80; lat <= 80; lat += 20) {
const start = this.latLongToXY(lat, -180);
const end = this.latLongToXY(lat, 180);
this.ctx.beginPath();
this.ctx.moveTo(start.x, start.y);
this.ctx.lineTo(end.x, end.y);
this.ctx.stroke();
}
// SDR 스테이션 그리기
stations.forEach(station => {
const pos = this.latLongToXY(station.location[0], station.location[1]);
// 스테이션 포인트
this.ctx.beginPath();
this.ctx.arc(pos.x, pos.y, 5, 0, Math.PI * 2);
this.ctx.fillStyle = '#0f0';
this.ctx.fill();
// 스테이션 이름
this.ctx.fillStyle = '#0f0';
this.ctx.font = '12px monospace';
this.ctx.fillText(station.name, pos.x + 10, pos.y + 5);
});
}
}
// 모니터 시스템 초기화
const monitor = new SDRMonitor();
</script>
</body>
</html> |