fix(B04): 새 관 기본값 — 유입 집수정이면 유입 흙막이 칸 안 채움 · 동물이동형 유 · 관경 수 (PLAN 623 · 요구 530 E1)

- `_apply_new_defaults` — 집수정 갈래면 `inlet_revet_*` 기본값 · 높이 안 채움 · `inlet_basin_animal` "true" · 등록부 관경 글 "1000" → 수
- 새 자동 관이 폼을 처음 거쳐도 파일이 안 바뀜(620 증상) · 옛 프로젝트 이주 없음
- 시험 — 새 `test_623_inlet_defaults`(폼 왕복 차 0 · `helper_623_inlet_defaults.cjs`) · 기대값 고침 `test_b05_new_structure_defaults` · `test_211_1`(기슭막이 관으로) · `test_b05_drainage_recommend`(관경 수)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-31 20:16:48 +09:00
co-authored by Claude Opus 5.5
parent 689727fc98
commit 77a7697768
6 changed files with 226 additions and 16 deletions
+12 -7
View File
@@ -257,21 +257,26 @@ def _apply_new_defaults(
if definition is None:
continue
options = dict(point.options or {})
given = set(options)
for field in definition.options:
if field.key not in options and field.default not in (None, ""):
options[field.key] = field.default
# 집수정 모양도 실제 값으로(54-39 · 54-36 기본 L형 — 화면 짝 `DEFAULT_BASIN_SHAPE`)
if options.get("inlet_type") == "집수정":
if "pipe_diameter_mm" not in given and isinstance(options.get("pipe_diameter_mm"), str):
options["pipe_diameter_mm"] = int(_float(options["pipe_diameter_mm"])) # 폼 = 수(623)
# 집수정 = 모양 L(54-39 · `DEFAULT_BASIN_SHAPE`) · 동물이동형 유 · 유입 흙막이 없음(623)
basin = options.get("inlet_type") == "집수정"
if basin:
options.setdefault("inlet_structure", "L")
# 관 보호공 · 유입 집수정 높이 = 관경 + 0.5(139-1 · 화면 짝 `PIPE_HEIGHT_KEYS`)
options.setdefault("inlet_basin_animal", "true")
for key in [k for k in options if k.startswith("inlet_revet_") and k not in given]:
del options[key]
# 보호공 · 집수정 높이 = 관경 + 0.5(139-1 · `PIPE_HEIGHT_KEYS`) · 유입 흙막이 + 0.7(211-1)
keys = {field.key for field in definition.options}
diameter_m = _float(options.get("pipe_diameter_mm")) / 1000
if diameter_m > 0:
for key in PIPE_HEIGHT_KEYS:
if key in keys:
side = (
"inlet" if key == "inlet_revet_height_m" else ""
) # 유입 흙막이 + 0.7(211-1)
if key in keys and not (basin and key.startswith("inlet_revet_")):
side = "inlet" if key == "inlet_revet_height_m" else ""
options.setdefault(key, pipe_wall_min_height_m(diameter_m, side))
if point.facility == "ford_bridge" and "ford_height_m" not in options:
flow = (flows or {}).get(round(point.chainage_m, 2))