diff --git a/frontend/public/fire-alarm-demo/index.html b/frontend/public/fire-alarm-demo/index.html index 411bd325..b41cfd8b 100644 --- a/frontend/public/fire-alarm-demo/index.html +++ b/frontend/public/fire-alarm-demo/index.html @@ -789,6 +789,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1107,9 +1169,9 @@ - ZONE 17 - - + ZONE 17 + + @@ -1857,6 +1919,30 @@ }); } + // 각 zone 중앙에 경광등 자동 삽입 (alarm/warn 시 자동 표시) + function attachBeacons() { + const NS = "http://www.w3.org/2000/svg"; + const W = 76, H = 76; // 정사각 viewBox 100x100 + document.querySelectorAll(".zone").forEach(group => { + const rect = group.querySelector(".zone-area"); + if (!rect) return; + const x = parseFloat(rect.getAttribute("x")); + const y = parseFloat(rect.getAttribute("y")); + const w = parseFloat(rect.getAttribute("width")); + const h = parseFloat(rect.getAttribute("height")); + const cx = x + w / 2; + const cy = y + h / 2; + const use = document.createElementNS(NS, "use"); + use.setAttribute("href", "#beacon"); + use.setAttribute("x", cx - W / 2); + use.setAttribute("y", cy - H / 2 - 6); // zone 중앙 약간 위 + use.setAttribute("width", W); + use.setAttribute("height", H); + use.setAttribute("class", "zone-beacon"); + group.appendChild(use); + }); + } + setClock(); setInterval(() => { setClock(); @@ -1867,6 +1953,7 @@ renderAll(); updatePressure(); bindSvgClick(); + attachBeacons(); addLog(`SYSTEM READY fire monitoring system initialized.`); addLog(`NORMAL all devices communication OK.`);