- 잇기 단추 글 「고르기」 → 「선택」(명세 · 정의 그룹 · 종류 단위 줄 공용) - 「지난 정의 값」 상자 모든 종류에서 숨김 — 값은 파일에 그대로 · 코드 남김 - 관 길이 = 보여 주는 칸(손 입력 칸 아님 · 정수 · 횡단 전 「횡단 설계 뒤 셈」) - 유입 집수정 = 길이 · 기준측점 전 · 후 칸 숨김 · 옛 값은 병합이 지킴 - 배관 유출 칸에 읽기 줄(관 길이 · 좌우 자동 자리 안내) 안 옮김 - [흙막이 추가] 없앰 — 흙막이 컨테이너 수 = 유출 「추가 기슭막이(단)」 N(늘 보임 · 줄면 끝에서 빠짐 · 잇기 함께 풂 · 이름 흙막이) - 단 수 소스 = 횡단 세션 값 → 캐시 patch · 종단 보기도 같은 횡단 자료(B05 = B06) - 지형이 단을 못 세워 되돌릴 때 캐시 patch 도 맞춤(옛 수로 돌아가던 흠) - 집계표 선택 컨테이너 이름 짝(서버) 흙막이 · 시험 기대값 · 52-1 · 52-13 화면 시나리오 고침 · 54-1 화면 점검 추가 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BVPp2o6Mh2FZJr72yW3ofZ
85 lines
3.4 KiB
Python
85 lines
3.4 KiB
Python
# -*- coding: utf-8 -*-
|
|
"""배관 남은 연동 — PLAN 52-1b.
|
|
|
|
못박는 것
|
|
- 집계표: 선택 컨테이너(흙막이 추가 · 도수로/돌붙임)마다 한 건 — 잇기 `{link}{n}` 항목 ·
|
|
그 컨테이너 값.
|
|
- 짝: 서버 컨테이너 표(머리 · 잇기) = 배관 명세 TS.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import json
|
|
import os
|
|
import re
|
|
|
|
from M02_MasterTemplete import M02_Table_Fill as fill
|
|
from M02_MasterTemplete.M02_Table_Fill_Spec import SPEC_CONTAINERS, container_rows
|
|
from resources.tester.test_structures_summary_snapshot import ( # noqa: F401 — world 고정물
|
|
MS,
|
|
PIPE,
|
|
RV,
|
|
_pipe,
|
|
_save,
|
|
world,
|
|
)
|
|
|
|
HERE = os.path.dirname(os.path.abspath(__file__))
|
|
ROOT = os.path.dirname(os.path.dirname(HERE))
|
|
SOIL = {
|
|
"soil_add_1_structure": "기슭막이",
|
|
"soil_add_1_form": "바자",
|
|
"soil_add_1_length": 6,
|
|
"soil_add_1_height": 2,
|
|
"soil_add_2_structure": "기슭막이",
|
|
"chute_add_1_structure": "돌붙임",
|
|
}
|
|
|
|
|
|
def test_컨테이너마다_한_건_잇기와_그_값():
|
|
item = {"type_id": "pipe", "options": {"pipe_diameter_mm": 1000, **SOIL}, "복사본": "pipe@40.0"}
|
|
rows = container_rows(item, {"gsoiladd1": RV, "gchuteadd1": MS})
|
|
assert [r["그룹"] for r in rows] == ["흙막이 1", "흙막이 2", "도수로/돌붙임 1"]
|
|
assert [r["복사본"] for r in rows] == [
|
|
"pipe@40.0__gsoiladd1",
|
|
"pipe@40.0__gsoiladd2",
|
|
"pipe@40.0__gchuteadd1",
|
|
]
|
|
assert [r["summary_item"] for r in rows] == [RV, None, MS]
|
|
first = rows[0]["options"]
|
|
assert first["length_m"] == first["inlet_revet_length_m"] == first["outlet_revet_length_m"] == 6
|
|
assert (
|
|
first["form"] == first["outlet_revet_form"] == "바자" and first["outlet_type"] == "기슭막이"
|
|
)
|
|
assert first["pipe_diameter_mm"] == 1000 # 구조물 옵션은 그대로
|
|
assert container_rows({"type_id": "masonry_dry", "options": SOIL, "복사본": "st0"}, {}) == []
|
|
# 옛 값 — 컨테이너 없는 옛 관 · 인스턴스 없는 잇기는 줄 없음
|
|
old = {"type_id": "pipe", "options": {"inlet_revet_length_m": 5}, "복사본": "pipe@9.0"}
|
|
assert container_rows(old, {"gsoiladd9": RV}) == []
|
|
|
|
|
|
def test_집계표_채움에_컨테이너_줄(world):
|
|
"""흙막이 추가 1 → 돌기슭막이 열(rv) 6 m · 관 본체 · 미지정 컨테이너는 표에 안 듦."""
|
|
root, system = world["root"], world["system"]
|
|
point = {**_pipe(PIPE), "group_items": {"gsoiladd1": RV}}
|
|
point["options"] = {**point["options"], **SOIL}
|
|
_save(root, [], [point])
|
|
table = json.loads((system / "table/구조물집계표.json").read_text("utf-8"))
|
|
doc = fill.fill_table(root, table)
|
|
values = [row["값"] for row in doc["줄"] if not row.get("고정")]
|
|
rv = [v for row in values for k, v in row.items() if k.split("|")[0] == "rv"]
|
|
assert rv == [6]
|
|
copies = [i["복사본"] for i in fill.collect_items(root)]
|
|
assert "pipe@40.0__gsoiladd1" in copies and "pipe@40.0__gchuteadd1" in copies
|
|
|
|
|
|
def test_서버_컨테이너_표는_배관_명세와_짝():
|
|
with open(
|
|
os.path.join(ROOT, "A00_Common/design/design_structure_pipe.ts"), encoding="utf-8"
|
|
) as f:
|
|
text = f.read()
|
|
found = re.findall(
|
|
r'title: "([^"]+)",\s*required: false,\s*prefix: "(\w+)",\s*link: "(\w+)"', text
|
|
)
|
|
assert [(p, link, t) for t, p, link in found] == list(SPEC_CONTAINERS["pipe"])
|