From 9b87ad13a031531fc22aebf5dcceaf87dd026c47 Mon Sep 17 00:00:00 2001 From: windpacer Date: Fri, 8 May 2026 18:11:05 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20pv=20=EA=B0=92=20=ED=8C=8C=EC=8B=B1=20?= =?UTF-8?q?=ED=97=AC=ED=8D=BC=20parseEnumPv()=20=EC=B6=94=EA=B0=80,=20?= =?UTF-8?q?=ED=8F=AC=EC=9D=B8=ED=8A=B8=EB=B9=8C=EB=8D=94=20=ED=85=8C?= =?UTF-8?q?=EC=9D=B4=EB=B8=94=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Web/wwwroot/js/app.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/Web/wwwroot/js/app.js b/src/Web/wwwroot/js/app.js index e483b5b..bd74e70 100644 --- a/src/Web/wwwroot/js/app.js +++ b/src/Web/wwwroot/js/app.js @@ -630,7 +630,7 @@ function pbRender(points) { ${esc(p?.id || '')} ${esc((p?.tagName)?.toUpperCase() || '')} - ${p?.liveValue != null ? esc(String(fmtVal(p.liveValue))) : ''} + ${p?.liveValue != null ? esc(String(fmtVal(parseEnumPv(p.liveValue)))) : ''} ${p?.liveValue != null ? fmtTs(p.timestamp) : '—'} @@ -2131,6 +2131,19 @@ function fmtVal(v) { return n.toFixed(2); } +/** + * OPC UA EnumValueType pv 값 파싱 + * "{0 | L-STpv | }" → "L-STpv" + * "{0 | MID | }" → "MID" + * 일반 값은 그대로 반환 + */ +function parseEnumPv(v) { + if (v == null) return v; + const s = String(v); + const m = s.match(/^\{\s*\d+\s*\|\s*([^|]+?)\s*\|\s*\}$/); + return m ? m[1].trim() : s; +} + // ═══════════════════════════════════════════════════════════════ // fastRecord — 변수 / 모달 헬퍼 // ═══════════════════════════════════════════════════════════════