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,