feat(B08): 암 환산계수 C = 연암 · 경암 비율 가중(연암 리핑 · 경암 발파 고정) — 토적표 조작 중 바로 · B06 유토곡선 다음 서버 계산 때(125-1)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BVPp2o6Mh2FZJr72yW3ofZ
This commit is contained in:
2026-10-08 19:42:14 +09:00
co-authored by Claude Opus 5.5
parent 681efb23d1
commit b6f9707a25
7 changed files with 274 additions and 31 deletions
+19 -17
View File
@@ -345,27 +345,29 @@ def earthwork_conversion_factors(settings: dict[str, Any]) -> dict[str, dict[str
ROCK_METHOD_KINDS = {ROCK_METHOD_RIPPING: "ripping_rock", ROCK_METHOD_BLASTING: "blasting_rock"}
def mixed_conversion_factors(settings: dict[str, Any]) -> dict[str, dict[str, float]]:
"""토적표·유토곡선·운반표가 **계산에** 쓸 계수 — 암은 구성비 가중 C (㉱ (나) · 2026-09-14).
def mixed_rock_c(soft_pct: float, ripping_c: float, blasting_c: float) -> float:
"""암 C = 연암 % × 리핑암 C + 경암 % × 발파암 C(0~100 자름 · 125-1).
B06 의 암은 한 종류 **자리표시**(`ripping_rock` · 옛 자료 `blasting_rock`)이고 암질은 설계내역에서
구성비로 정함(8-1 사용자 확정). 그래서 구성비와 갈래별 시공법이 **다 서면** 암 두 칸을
Σ몫 × C(시공법)로 갈음 — 몫은 흙깎기와 같은 안분(준 비율끼리 · 합이 100 이 아니어도 안분).
⚠ 구성비가 비거나 시공법이 빠진 갈래가 있으면 **종전 값** — 인계가 막힘 사유를 내고, 지어낸 계수를 안 씀.
짝 — `B08_Quantity_Options_Calc.ts` `mixedRockC`(거울 시험 `test_122_b08_options_mirror`).
"""
soft = min(max(soft_pct, 0.0), 100.0) / 100.0
return soft * ripping_c + (1.0 - soft) * blasting_c
def mixed_conversion_factors(settings: dict[str, Any]) -> dict[str, dict[str, float]]:
"""토적표·유토곡선·운반표가 **계산에** 쓸 계수 — 암은 연암 · 경암 비율 가중 C (125-1).
B06 의 암은 한 종류 **자리표시**(`ripping_rock` · 옛 자료 `blasting_rock`)라 암 두 칸을
`mixed_rock_c(연암 %, 리핑암 C, 발파암 C)` 하나로 갈음 — 비율 = `soft_rock_pct`(기본 90 : 10 · 122).
시공법은 연암 = 리핑암 · 경암 = 발파암 고정(브레인 정함) — `rock_methods` 를 안 읽음.
⚠ 화면 「무엇을 골랐나」(`earthwork_conversion_choices`)는 갈래별 값 그대로 — 여기 값을 보이면 안 됨.
"""
resolved = earthwork_conversion_factors(settings)
ratios = settings.get("rock_ratios_pct") or {}
shares = {
name: float(ratios.get(name) or 0)
for name in rock_classes(settings)
if name != "토사" and float(ratios.get(name) or 0) > 0
}
kinds = {name: ROCK_METHOD_KINDS.get(rock_method(settings, name) or "") for name in shares}
if not shares or not all(kinds.values()):
return resolved
total = sum(shares.values())
mixed = sum(shares[name] / total * resolved[kind]["compacted"] for name, kind in kinds.items())
mixed = mixed_rock_c(
soft_rock_pct(settings),
resolved["ripping_rock"]["compacted"],
resolved["blasting_rock"]["compacted"],
)
for kind in ROCK_METHOD_KINDS.values():
resolved[kind]["compacted"] = mixed
return resolved