feat(B06): 관보호공 유입 · 유출 · 유입 집수정 높이 기본 = 관경 + 0.5 · 그림이 칸 값 읽음 · 옛 1.5(관경 > 1.0) 읽을 때 옮김 · 관경 바꾸면 따라감(139-1)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01F3mdb91125mPoC6tpsQx4P
This commit is contained in:
@@ -25,6 +25,7 @@ from fastapi.responses import JSONResponse
|
||||
|
||||
from B04_PreProcess.B04_PreProcess_Engine_Watershed_Export import drainage_dir
|
||||
from B05_Profile.B05_Profile_Structures_Schema import structure_type_map
|
||||
from B06_Section.B06_Section_Engine_Culvert import pipe_wall_min_height_m
|
||||
from common_util.common_util_drainage_context import DrainageContext, load_drainage_context
|
||||
from common_util.common_util_drainage_detail import DrainageDetail, build_detail
|
||||
from common_util.common_util_drainage_pipes import (
|
||||
@@ -89,6 +90,17 @@ def _build(
|
||||
return detail, carried
|
||||
|
||||
|
||||
# 관 보호공 · 유입 집수정 높이 칸 — 새 관 기본 = 관경 + 0.5(139-1)
|
||||
PIPE_HEIGHT_KEYS = ("inlet_revet_height_m", "outlet_revet_height_m", "inlet_basin_height_m")
|
||||
|
||||
|
||||
def _float(value: Any) -> float:
|
||||
try:
|
||||
return float(value)
|
||||
except (TypeError, ValueError):
|
||||
return 0.0
|
||||
|
||||
|
||||
def _apply_new_defaults(
|
||||
points: list[PipePoint], flows: dict[float, float | None] | None = None
|
||||
) -> None:
|
||||
@@ -111,6 +123,13 @@ def _apply_new_defaults(
|
||||
# 집수정 모양도 실제 값으로(54-39 · 54-36 기본 L형 — 화면 짝 `DEFAULT_BASIN_SHAPE`)
|
||||
if options.get("inlet_type") == "집수정":
|
||||
options.setdefault("inlet_structure", "L")
|
||||
# 관 보호공 · 유입 집수정 높이 = 관경 + 0.5(139-1 · 화면 짝 `PIPE_HEIGHT_KEYS`)
|
||||
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:
|
||||
options.setdefault(key, pipe_wall_min_height_m(diameter_m))
|
||||
if point.facility == "ford_bridge" and "ford_height_m" not in options:
|
||||
flow = (flows or {}).get(round(point.chainage_m, 2))
|
||||
height = ford_height_m(flow, float(options.get("ford_width_m") or 0))
|
||||
|
||||
Reference in New Issue
Block a user