From f6b5b9f9c18bc750d6730c19427568cb366da0e1 Mon Sep 17 00:00:00 2001 From: umsangdon Date: Tue, 8 Sep 2026 23:13:06 +0900 Subject: [PATCH] =?UTF-8?q?feat(B08):=20=EA=B5=AC=EC=A1=B0=EB=AC=BC=20?= =?UTF-8?q?=EC=9E=94=ED=86=A0=20=EC=B8=A1=EC=A0=90=EA=B0=92=EC=97=90=20?= =?UTF-8?q?=EC=A7=80=EB=B0=98=20=EA=B0=88=EB=9E=98=EB=A5=BC=20=ED=95=A8?= =?UTF-8?q?=EA=BB=98=20=EC=8B=A4=EC=9D=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 새 판정이 아니라 구조물터파기가 쓰는 그 값(`design.ground_type` 판정) 그대로 — 그 터파기에서 나온 흙이 곧 이 잔토라 두 자리가 같은 판정을 씀 - 섞여서 못 고른 구조물은 「모름」(None)으로 보냄 — 터파기에서 다수결로 안 고른 규칙 그대로 - 한계도 그대로 넘어감(터파기 깊이가 암반 경계보다 깊은지는 안 봄) — 사유에 적음 - 받는 쪽(B06)이 사토 잔량 ea/rr/br 에 넣으면 「모르는 몫」이 사라짐 - tmp/tests 2건 추가 Co-Authored-By: Claude Opus 5 (1M context) --- .../B08_Quantity_Engine_HaulInputs.py | 27 ++++++++++++++++--- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/B08_Quantity/B08_Quantity_Engine_HaulInputs.py b/B08_Quantity/B08_Quantity_Engine_HaulInputs.py index 9adf16ca..c1c2894d 100644 --- a/B08_Quantity/B08_Quantity_Engine_HaulInputs.py +++ b/B08_Quantity/B08_Quantity_Engine_HaulInputs.py @@ -11,13 +11,21 @@ ⚠ **측점별로도 낸다.** 총량 하나만 주면 받는 쪽이 잔량 크기에 비례해 나눌 수밖에 없고, 그러면 **운반거리가 틀어진다**(한 곳에 몰리면 거리가 어긋남 — 공제 때 이미 짚은 자리). 구조물은 구간(start~end)이라 **그 가운데 측점**을 자리로 본다. + +⚠ **지반 갈래도 함께 낸다** — 새 판정이 아니라 **구조물터파기가 이미 쓰는 그 값**이다 + (`design.ground_type` 에서 뽑아 「암절취 · 심도 2~3m」로 세운 그것). 그 터파기에서 나온 + 흙이 곧 이 잔토이므로 **같은 판정을 두 곳이 그대로 쓴다** — 두 벌로 짜면 갈린다. + ⚠ **섞여서 못 고른 구조물은 「모름」(`None`)으로 보낸다** — 터파기에서 다수결로 안 고른 + 그 규칙 그대로다. 받는 쪽이 그 몫을 「모르는 몫」으로 드러내면 된다. + ⚠ **한계도 그대로 넘어간다** — 「터파기 깊이가 암반 경계선보다 깊은지」는 보지 않는다. + 터파기 토질에 이미 있는 한계이고 여기서 새로 생기는 것이 아니다. """ from __future__ import annotations from typing import Any -from B08_Quantity.B08_Quantity_Engine_UnitQuantity import COLLECTED_STONE_KEY +from B08_Quantity.B08_Quantity_Engine_UnitQuantity import COLLECTED_STONE_KEY, GROUND_TYPE_LABEL #: 유토곡선이 읽는 칸 이름 — 양쪽이 같은 낱말을 써야 인계에서 어긋나지 않는다. STRUCTURE_SPOIL_KEY = "structure_spoil_m3" @@ -46,7 +54,7 @@ def haul_inputs(unit_quantity_table: dict[str, Any] | None) -> dict[str, Any]: STRUCTURE_SPOIL_POINTS_KEY: [], } total = 0.0 - points: list[dict[str, float]] = [] + points: list[dict[str, Any]] = [] for structure in unit_quantity_table.get("structures") or []: amount = 0.0 for component in structure.get("components") or []: @@ -57,8 +65,19 @@ def haul_inputs(unit_quantity_table: dict[str, Any] | None) -> dict[str, Any]: continue total += amount chainage = _center(structure) - if chainage is not None: - points.append({"chainage_m": chainage, "spoil_m3": round(amount, 3)}) + if chainage is None: + continue + # 지반 갈래 — 구조물터파기가 쓰는 그 판정을 그대로 싣는다(두 벌로 안 짠다). + ground = structure.get("ground_type") or None + points.append( + { + "chainage_m": chainage, + "spoil_m3": round(amount, 3), + "ground_type": ground, + "ground_label": GROUND_TYPE_LABEL.get(str(ground)) if ground else None, + "ground_basis": str(structure.get("ground_type_basis") or ""), + } + ) collected = unit_quantity_table.get(COLLECTED_STONE_KEY) return { COLLECTED_STONE_KEY: collected,