diff --git a/B06_Section/B06_Section_Engine_Culvert.py b/B06_Section/B06_Section_Engine_Culvert.py index ce97262f9..87fb59003 100644 --- a/B06_Section/B06_Section_Engine_Culvert.py +++ b/B06_Section/B06_Section_Engine_Culvert.py @@ -327,7 +327,8 @@ def _wing_spec(values: dict[str, Any], defaults: dict[str, Any], side: str) -> d height = _number( values.get(f"{prefix}_height_m"), _number(defaults.get(f"{prefix}_height_m"), 0.0) ) - installed = str(install or "").strip() != "없음" + # BOX암거 유입·유출 구조(표 02) — 없음 · 날개벽 · 흙막이 · 옛 값 있음 = 날개벽. 날개벽만 세움. + installed = str(install or "").strip() not in ("없음", "흙막이") extend = (length or 0.0) * math.cos(math.radians(angle or 0.0)) if installed else 0.0 return { "installed": installed, diff --git a/common_util/common_util_culvert_sets.ts b/common_util/common_util_culvert_sets.ts index f9055b0ac..d53993a58 100644 --- a/common_util/common_util_culvert_sets.ts +++ b/common_util/common_util_culvert_sets.ts @@ -241,7 +241,8 @@ function wingSpec( const length = num(values[`${prefix}_length_m`], num(defaults[`${prefix}_length_m`], 0.0)); const angle = num(values[`${prefix}_angle_deg`], num(defaults[`${prefix}_angle_deg`], 45.0)); const height = num(values[`${prefix}_height_m`], num(defaults[`${prefix}_height_m`], 0.0)); - const installed = String(install ?? "").trim() !== "없음"; + // BOX암거 유입·유출 구조(표 02) — 없음 · 날개벽 · 흙막이 · 옛 값 있음 = 날개벽. 날개벽만 세움. + const installed = !["없음", "흙막이"].includes(String(install ?? "").trim()); return { installed, height_m: height, diff --git a/resources/tester/test_b06_box_set.py b/resources/tester/test_b06_box_set.py index c88753e6c..ca213b8a2 100644 --- a/resources/tester/test_b06_box_set.py +++ b/resources/tester/test_b06_box_set.py @@ -45,6 +45,14 @@ def test_box_wing_extends_slab() -> None: assert spec["wing_in"]["slab_extend_m"] == round(2 * math.cos(math.radians(45)), 3) +def test_box_structure_choices() -> None: + """유입·유출 구조(표 02) — 날개벽 · 옛 값 있음만 날개벽을 세움 · 흙막이 · 없음은 안 세움.""" + for value, installed in (("날개벽", True), ("있음", True), ("흙막이", False), ("없음", False)): + spec = _box_set({"wing_in": value, "wing_in_length_m": 2}) + assert spec["wing_in"]["installed"] is installed + assert (spec["wing_in"]["slab_extend_m"] > 0) is installed + + def test_attach_box_only_owner_station(tmp_path: Path) -> None: """BOX암거는 **소유 측점 한 곳에만** `box` 키로 붙는다(2026-08-25 사용자 확정). diff --git a/resources/tester/test_b06_culvert_sets_mirror.py b/resources/tester/test_b06_culvert_sets_mirror.py index b92cc6499..9ddacc95d 100644 --- a/resources/tester/test_b06_culvert_sets_mirror.py +++ b/resources/tester/test_b06_culvert_sets_mirror.py @@ -58,7 +58,13 @@ POINTS = [ { "chainage_m": 80.0, "facility": "box_culvert", - "options": {"body_width_m": 3.0, "body_height_m": 2.5, "wing_out_length_m": 2.0}, + "options": { + "body_width_m": 3.0, + "body_height_m": 2.5, + "wing_in": "날개벽", + "wing_out": "흙막이", + "wing_out_length_m": 2.0, + }, }, { "chainage_m": 100.0,