From 7385b4d76f99bbca14f0bbea63abf6f7cae34964 Mon Sep 17 00:00:00 2001 From: umsangdon Date: Sun, 30 Aug 2026 12:23:38 +0900 Subject: [PATCH] =?UTF-8?q?fix(B06):=20=EC=9B=94=EB=A5=98=20=ED=8F=AD?= =?UTF-8?q?=EC=9D=84=20=EB=B0=94=EA=BE=B8=EB=A9=B4=20=EC=9B=94=EB=A5=98=20?= =?UTF-8?q?=EB=86=92=EC=9D=B4(=ED=95=84=EC=9A=94=20=EC=88=98=EC=8B=AC)?= =?UTF-8?q?=EA=B0=80=20=EB=94=B0=EB=9D=BC=EC=98=A4=EA=B2=8C=20=ED=95=9C?= =?UTF-8?q?=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `syncFordSummary`가 "빈 칸이거나 계산값보다 작을 때만" 높이를 채워 넣어, 폭을 바꿔 필요 수심이 **낮아지는** 쪽으로 움직이면 칸이 옛 값 그대로 남았다. 안내문 (설계유량·필요 수심·필요 단면)만 바뀌고 높이는 안 바뀌는 것으로 보였다. 칸이 아직 **직전에 자동으로 채운 값 그대로**인지 본다(±0.005m). 그대로면 자동 상태로 보고 계산값을 계속 따라가고, 사용자가 다른 값을 넣었으면 그때부터 그 값이 이긴다. 시설을 새로 폼에 올릴 때는 추적을 끊어(`fordAutoDepthM = null`) 저장돼 있던 높이를 사용자 값으로 대접한다. 자체검증(공용 브라우저 5174, 측점 7+9.7 세월교, 설계유량 36.734 ㎥/s): - tsc --noEmit 통과. - 자동 상태(폭 10 → 높이 0.39)에서 폭 5 → 0.63(올라감), 폭 20 → 0.25(내려감). 수정 전에는 0.63에서 내려오지 않았다. - 높이를 2.5로 직접 넣은 뒤 폭 20→5 → 2.5 유지(사용자 값 우선). - 조작값은 원래대로(폭 10 · 높이 자동 0.39) 되돌려 놓았다. Co-Authored-By: Claude Opus 5 (1M context) --- B05_Profile/B05_Profile_UI_Drainage_Facility.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/B05_Profile/B05_Profile_UI_Drainage_Facility.ts b/B05_Profile/B05_Profile_UI_Drainage_Facility.ts index 8469ecd8..a9f53b27 100644 --- a/B05_Profile/B05_Profile_UI_Drainage_Facility.ts +++ b/B05_Profile/B05_Profile_UI_Drainage_Facility.ts @@ -385,6 +385,10 @@ export function createFacilityOptionsForm( let designFlowM3s: number | null = null; /** 현재 조건(설계유량·월류 폭)의 필요 최소 수심(m). 계산 불가면 null. */ let fordMinDepthM: number | null = null; + /** 직전에 자동으로 채워 넣은 필요 수심(m) — 칸이 아직 그 값이면 "자동"으로 보고 + * 월류 폭이 바뀔 때마다 계산값을 계속 따라가게 한다. 사용자가 다른 값을 넣으면 + * 그때부터 그 값이 이긴다(2026-08-30 사용자: 폭을 바꿔도 높이가 안 따라온다). */ + let fordAutoDepthM: number | null = null; function syncFordSummary(): void { const section = @@ -393,10 +397,14 @@ export function createFacilityOptionsForm( : null; fordMinDepthM = section ? section.depthM : null; if (section) { - // 표시 정밀도(0.01m)로 맞춘 최소값 — 비었거나 그보다 작으면 계산값으로 채운다. + // 표시 정밀도(0.01m)로 맞춘 최소값 — 비었거나, 그보다 작거나, 아직 직전 + // 자동값 그대로면 계산값으로 다시 채운다. const min = Number(section.depthM.toFixed(2)); const current = Number.parseFloat(fordHeight.value); - if (!Number.isFinite(current) || current < min) fordHeight.value = min.toFixed(2); + const untouched = fordAutoDepthM !== null && Math.abs(current - fordAutoDepthM) < 0.005; + if (!Number.isFinite(current) || current < min || untouched) + fordHeight.value = min.toFixed(2); + fordAutoDepthM = min; } if (designFlowM3s === null) { fordSummary.textContent = @@ -615,6 +623,8 @@ export function createFacilityOptionsForm( fordCount.value = isFord ? text("pipe_count") : ""; fordWidth.value = text("ford_width_m"); fordHeight.value = text("ford_height_m"); + // 새 시설을 올리는 참이다 — 저장된 높이는 사용자 값으로 보고 자동 추적을 끊는다. + fordAutoDepthM = null; fordSlope.value = text("ford_slope_pct"); revetSide.value = text("side") || "양쪽"; const spread = legacyRevetOptions(options);