diff --git a/B07_DesignDetail/B07_DesignDetail_Api_Fetch.ts b/B07_DesignDetail/B07_DesignDetail_Api_Fetch.ts index 696c3f773..2efd5bcc4 100644 --- a/B07_DesignDetail/B07_DesignDetail_Api_Fetch.ts +++ b/B07_DesignDetail/B07_DesignDetail_Api_Fetch.ts @@ -41,6 +41,8 @@ export interface CadDrawing { stale_layout?: boolean; /** 횡단 장 — 지금과 다른 표 · 글 배율로 확정된 저장본(180-2). */ stale_scale?: boolean; + /** 횡단 장 — 측점 도면층(212-2) 앞에 확정된 저장본. [수정]을 누르면 측점 층으로 다시 만든다. */ + stale_layers?: boolean; layers: { id: string; name: string; diff --git a/B07_DesignDetail/B07_DesignDetail_Engine_Cad_Sheet.py b/B07_DesignDetail/B07_DesignDetail_Engine_Cad_Sheet.py index e2b8d5eb5..1dc94c77b 100644 --- a/B07_DesignDetail/B07_DesignDetail_Engine_Cad_Sheet.py +++ b/B07_DesignDetail/B07_DesignDetail_Engine_Cad_Sheet.py @@ -5,6 +5,8 @@ 칸 가운데 · 작성 척도 1/100 그대로(큰 단면이 칸을 넘으면 겹침 — 사용자 배치로 고침). 칸 = 인쇄되는 표 격자선 · 블록 테두리 없음 · 칸보다 큰 단면은 `overflow_cells`(169-2). 칸 안 = 표를 칸 아래 가운데에 먼저 · 그 위 글 · 그림(도로 중심 = 칸 가운데)(174-1). +측점마다 도면층 하나(「횡단 No.3」) = 원지반 · 계획선 · 구조물 · 암 그림 · 종류는 색 · 선 꼴 +· 표 · 글은 수량표 층(212-2). """ import re @@ -52,6 +54,10 @@ CROSS_SHEET_ID = re.compile(r"cross_s(\d{2,}(?:\.\d{2})?)m?") _BORDER_PAD_MM = CROSS_BORDER_PAD_MM # 칸 아래선 ~ 표 아래선 여백(mm) — 같은 행 표가 한 높이(174-1) CELL_TABLE_PAD_MM = 5.0 +# 측점 도면층 id 머리(212-2) — 뒤에 측점 · DXF 층 이름도 이 id +STATION_LAYER_PREFIX = "b08-station-" +# 측점 층으로 옮길 그림 종류 층 — 표 · 글(수량표 층)은 그대로 +_DRAWING_LAYER_IDS = {GROUND_LAYER_ID, DESIGN_LAYER_ID, STRUCTURE_LAYER_ID, ROCK_LAYER_ID} def _design_points(design_line: list[Any] | None) -> list[tuple[float, float]]: @@ -178,11 +184,20 @@ def _grid_lines(sheet_id: str, cols: int, rows: int) -> list[dict[str, Any]]: ] +def _move_to_layer(entity: dict[str, Any], layer_id: str) -> None: + """그림 종류 층 개체(자식 선까지)를 측점 층으로 — id 는 그대로(212-2).""" + if entity.get("layerId") in _DRAWING_LAYER_IDS: + entity["layerId"] = layer_id + for child in entity.get("children") or []: + child["layerId"] = layer_id + + def build_cross_sheet(sheet: dict[str, Any], sections: list[dict[str, Any]]) -> dict[str, Any]: """한 장을 만든다. sections는 이 장에 담을 측점 입력들(배치 순서대로).""" entities: list[dict[str, Any]] = [] placements: list[dict[str, Any]] = [] overflow: list[list[float]] = [] + station_layers: list[dict[str, Any]] = [] slots = sheet.get("slots") or [] cols, rows = sheet.get("grid") or (4, 4) usable_w, usable_h = usable_area() @@ -222,8 +237,17 @@ def build_cross_sheet(sheet: dict[str, Any], sections: list[dict[str, Any]]) -> group_id = str(uuid5(_ENTITY_NS, f"{seed_id}:group")) for entity in placed["entities"]: entity["groupId"] = group_id + # 측점 도면층(212-2) — 층 관리에서 그 측점 그림만 고르기 · 켜고 끄기 · 잠그기 + layer_id = f"{STATION_LAYER_PREFIX}{section['chainage']}" + title = section.get("title") or f"{section['chainage']}" + station_layers.append(_layer(layer_id, f"횡단 {title}")) + design_ids = [e["id"] for e in placed["entities"] if e["layerId"] == DESIGN_LAYER_ID] + for entity in placed["entities"]: + _move_to_layer(entity, layer_id) for placement in placed.get("cross_placements") or []: placement["group_id"] = group_id + placement["layer_id"] = layer_id + placement["design_ids"] = design_ids # 화면이 다시 그려 갈아 끼울 서버 설계선 entities.extend(placed["entities"]) placements.extend(placed.get("cross_placements") or []) @@ -246,10 +270,7 @@ def build_cross_sheet(sheet: dict[str, Any], sections: list[dict[str, Any]]) -> # 칸보다 큰 단면의 칸 [x0, y0, x1, y1] — 라우터가 CAD 가이드 붉은 틀로 보냄(169-2) "overflow_cells": overflow, "layers": [ - _layer(GROUND_LAYER_ID, "원지반"), - _layer(DESIGN_LAYER_ID, "계획선"), - _layer(STRUCTURE_LAYER_ID, "구조물"), - _layer(ROCK_LAYER_ID, "암 경계선"), + *station_layers, _layer(CROSS_TABLE_LAYER_ID, "수량 산출표"), _layer(FRAME_LAYER_ID, "도각", locked=True), ], diff --git a/B07_DesignDetail/B07_DesignDetail_Router_Support.py b/B07_DesignDetail/B07_DesignDetail_Router_Support.py index b63a43981..c70185032 100644 --- a/B07_DesignDetail/B07_DesignDetail_Router_Support.py +++ b/B07_DesignDetail/B07_DesignDetail_Router_Support.py @@ -18,6 +18,7 @@ from B05_Profile.B05_Profile_Engine_Sections import ( from B06_Section.B06_Section_Engine_Design import compute_cross_design, curve_widening_args from B07_DesignDetail.B07_DesignDetail_Engine_Cad import ( DRAWING_FORMAT, + GROUND_LAYER_ID, build_cross_drawing, infer_station_interval, station_no_label, @@ -32,6 +33,7 @@ from B07_DesignDetail.B07_DesignDetail_Engine_Cad_MassHaul import build_mass_hau from B07_DesignDetail.B07_DesignDetail_Engine_Cad_PlanKinds import build_plan_kind_drawing from B07_DesignDetail.B07_DesignDetail_Engine_Cad_Sheet import ( CROSS_SHEET_ID, + STATION_LAYER_PREFIX, build_cross_sheet, plan_cross_sheets, ) @@ -462,12 +464,22 @@ def _read_drawing( else: kind = "longitudinal" if _LONG_ID.fullmatch(drawing_id) else "cross" label = str(manifest_entry.get("label") or drawing_id) + layers = [layer for layer in saved.get("layers") or [] if isinstance(layer, dict)] + if kind == "cross": + # 180-1 앞 확정본 = 원지반 층 잠금째 저장 — 열 때 풂(212-1) + for layer in layers: + if layer.get("id") == GROUND_LAYER_ID: + layer["isLocked"] = False if kind == "cross" and manifest_entry.get("layout") != CROSS_SHEET_LAYOUT: saved["stale_layout"] = True # 화면이 [수정] → 새 배치로 다시 만들기를 안내 elif kind == "cross" and drawing_id.startswith("cross_s"): scale = read_cross_layout(project_root)["table_scale"] if manifest_entry.get("table_scale", 1.0) != scale: saved["stale_scale"] = True # 옛 배율로 확정한 장 — 그대로 두고 안내(180-2) + elif not any( + str(layer.get("id")).startswith(STATION_LAYER_PREFIX) for layer in layers + ): + saved["stale_layers"] = True # 측점 층 앞 확정본 — [수정] 때 측점 층(212-2) stored_table = manifest_entry.get("quantity_table") table = stored_table if kind == "cross" and isinstance(stored_table, dict) else None return kind, label, saved, True, table diff --git a/B07_DesignDetail/B07_DesignDetail_UI_Cad_Structures.ts b/B07_DesignDetail/B07_DesignDetail_UI_Cad_Structures.ts index f0e55d6ba..c4e446c65 100644 --- a/B07_DesignDetail/B07_DesignDetail_UI_Cad_Structures.ts +++ b/B07_DesignDetail/B07_DesignDetail_UI_Cad_Structures.ts @@ -34,6 +34,16 @@ export interface CrossPlacement { frame?: number[]; /** 측점 한 벌 묶음(180-1) — 덧그림도 같은 묶음으로 함께 골라짐. */ group_id?: string; + /** 측점 도면층(212-2) — 덧그림도 그 층에. */ + layer_id?: string; + /** 갈아 끼울 서버 설계선 id(212-2) — 측점 층이면 층으로는 못 가림. */ + design_ids?: string[]; +} + +/** 개체(자식 선까지)를 측점 층으로(212-2). */ +function moveToLayer(entity: Entity, layerId: string): void { + entity.layerId = layerId; + for (const child of (entity.children as Entity[] | undefined) ?? []) moveToLayer(child, layerId); } /** 측점과 도면 배치를 같은 자리로 볼 허용 오차(m). 정본이 누가거리를 0.01m로 끊어 쓴다. */ @@ -62,6 +72,7 @@ export async function appendStructureEntities( let added = 0; const fresh: Entity[] = []; const replaced: number[][] = []; + const designIds = new Set(); for (const placement of placements) { const section = sections.find( (item) => Math.abs(item.chainage_m - placement.chainage_m) <= CHAINAGE_TOLERANCE_M, @@ -81,6 +92,8 @@ export async function appendStructureEntities( } if (!entities.length) continue; if (placement.group_id) for (const entity of entities) entity.groupId = placement.group_id; + if (placement.layer_id) for (const entity of entities) moveToLayer(entity, placement.layer_id); + for (const id of placement.design_ids ?? []) designIds.add(id); // 이 블록 설계선은 우리가 다시 그렸다 — 서버가 낸 트림 전 설계선은 걷어낸다. replaced.push(frame); fresh.push(...entities); @@ -89,7 +102,7 @@ export async function appendStructureEntities( if (replaced.length) { // 걷어내기는 새 엔티티를 넣기 **전에** 한다 — 뒤에 하면 우리 것까지 같이 지운다. drawing.entities = drawing.entities.filter((entity) => { - if (entity.layerId !== DESIGN_LAYER_ID) return true; + if (entity.layerId !== DESIGN_LAYER_ID && !designIds.has(entity.id as string)) return true; const box = entityBox(entity); if (!box) return true; return !replaced.some( diff --git a/B07_DesignDetail/B07_DesignDetail_UI_Page.ts b/B07_DesignDetail/B07_DesignDetail_UI_Page.ts index 22499e06f..4ee7d0a34 100644 --- a/B07_DesignDetail/B07_DesignDetail_UI_Page.ts +++ b/B07_DesignDetail/B07_DesignDetail_UI_Page.ts @@ -365,6 +365,11 @@ export async function renderB07DesignDetail(root: HTMLElement): Promise { "옛 표 배율로 확정된 장입니다. [수정]을 누르면 지금 배율로 다시 만듭니다.", "info", ); + } else if (response.drawing.stale_layers) { + showToast( + "측점 도면층 앞에 확정된 장입니다. [수정]을 누르면 측점마다 층(횡단 No.)으로 다시 만듭니다.", + "info", + ); } } catch (error) { cad.fail(error instanceof Error ? error.message : "CAD 도면을 불러오지 못했습니다."); diff --git a/resources/tester/test_174_b07_cross_cell_stack.py b/resources/tester/test_174_b07_cross_cell_stack.py index cb4982436..eefcac2ce 100644 --- a/resources/tester/test_174_b07_cross_cell_stack.py +++ b/resources/tester/test_174_b07_cross_cell_stack.py @@ -11,7 +11,7 @@ import pytest -from B07_DesignDetail.B07_DesignDetail_Engine_Cad import GROUND_LAYER_ID +from B07_DesignDetail.B07_DesignDetail_Engine_Cad import GROUND_COLOR from B07_DesignDetail.B07_DesignDetail_Engine_Cad_Sheet import ( CELL_TABLE_PAD_MM, build_cross_sheet, @@ -95,7 +95,9 @@ def test_같은_행_표_한_높이_그림_중심_칸_가운데() -> None: assert tables[0][0] == pytest.approx(tables[1][0]) # 도로 중심(offset 0) = 칸 가운데 · 그림(원지반) 아래 끝 = 글(없으면 표) 위 8 mm grounds = [ - entities_bbox([e]) for e in drawing["entities"] if e.get("layerId") == GROUND_LAYER_ID + entities_bbox([e]) + for e in drawing["entities"] + if e.get("type") == "PolyLine" and e.get("lineColor") == GROUND_COLOR ] for placement, slot, table, design, ground in zip( drawing["cross_placements"], sheet["slots"], tables, designs, grounds, strict=True diff --git a/resources/tester/test_180_2_b07_cross_scale.py b/resources/tester/test_180_2_b07_cross_scale.py index 3fc8dec6e..e9d47710d 100644 --- a/resources/tester/test_180_2_b07_cross_scale.py +++ b/resources/tester/test_180_2_b07_cross_scale.py @@ -14,7 +14,7 @@ from pathlib import Path import pytest -from B07_DesignDetail.B07_DesignDetail_Engine_Cad import DRAWING_FORMAT, GROUND_LAYER_ID +from B07_DesignDetail.B07_DesignDetail_Engine_Cad import DRAWING_FORMAT, GROUND_COLOR from B07_DesignDetail.B07_DesignDetail_Engine_Cad_Sheet import ( CELL_TABLE_PAD_MM, build_cross_sheet, @@ -81,7 +81,9 @@ def test_배율_15_표_크기와_쌓기() -> None: bottom = shape["origin"]["y"] - sum(shape["rowHeights"]) assert bottom == pytest.approx(slot[1] - h / 4 + CELL_TABLE_PAD_MM) # 표 아래선 그대로 grounds = [ - entities_bbox([e]) for e in drawing["entities"] if e.get("layerId") == GROUND_LAYER_ID + entities_bbox([e]) + for e in drawing["entities"] + if e.get("type") == "PolyLine" and e.get("lineColor") == GROUND_COLOR ] # 글 2 줄 × 3.0 × 1.5 = 9 mm · 간격 8 mm 는 배율 안 탐 tops = [t["shapeData"]["origin"]["y"] for t in tables] diff --git a/resources/tester/test_180_b07_cross_group.py b/resources/tester/test_180_b07_cross_group.py index 4feffb1a1..d98296baa 100644 --- a/resources/tester/test_180_b07_cross_group.py +++ b/resources/tester/test_180_b07_cross_group.py @@ -10,6 +10,7 @@ from B07_DesignDetail.B07_DesignDetail_Engine_Cad import ( FRAME_LAYER_ID, + GROUND_COLOR, GROUND_LAYER_ID, build_cross_drawing, ) @@ -57,7 +58,9 @@ def _ground_locked(drawing: dict) -> bool: def test_원지반_층_안_잠김() -> None: - assert _ground_locked(_drawing()) is False + # 장 = 원지반이 측점 층에(212-2) · 도각 말고 잠긴 층 없음 + layers = _drawing()["layers"] + assert not any(layer["isLocked"] for layer in layers if layer["id"] != FRAME_LAYER_ID) single = build_cross_drawing(_source(0.0), "cross_00000m", _design_line(), None, None, "") assert _ground_locked(single) is False @@ -72,9 +75,9 @@ def test_측점마다_groupId_하나() -> None: assert {e["groupId"] for e in grouped} == set(group_ids) for group_id in group_ids: members = [e for e in grouped if e["groupId"] == group_id] - layers = {e["layerId"] for e in members} types = {e["type"] for e in members} - assert GROUND_LAYER_ID in layers and "Table" in types and "Text" in types + ground = any(e["type"] == "PolyLine" and e["lineColor"] == GROUND_COLOR for e in members) + assert ground and "Table" in types and "Text" in types # 격자선 · 도각은 묶지 않음 assert all("groupId" not in e for e in drawing["entities"] if e["layerId"] == FRAME_LAYER_ID) assert all(e["layerId"] != FRAME_LAYER_ID for e in grouped) diff --git a/resources/tester/test_212_b07_cross_station_layers.py b/resources/tester/test_212_b07_cross_station_layers.py new file mode 100644 index 000000000..baa293a31 --- /dev/null +++ b/resources/tester/test_212_b07_cross_station_layers.py @@ -0,0 +1,185 @@ +# -*- coding: utf-8 -*- +"""212-1 · 212-2 B07 횡단 장 — 원지반 고르기 · 측점별 도면층. + +못박는 것 + - 212-1 옛 확정 장(원지반 층 잠금째 저장)도 열 때 원지반 잠금 풂 · 측점 층 없으면 stale_layers. + - 212-2 장의 측점마다 층 하나(`b08-station-{측점}` · 이름 「횡단 {제목}」) = 원지반 · 계획선 · + 암 그림(자식 선까지) · 표 · 글은 수량표 층 · 격자선 · 도각은 도각 층 · 종류 층 없음. + - 개체 id 는 그대로(층만 바뀜) · placement 에 layer_id · design_ids(화면 덧그림 갈아 끼우기). + - DXF 층 이름 = 측점 층 id 그대로(금지 문자 없음). + - 화면 덧그림도 측점 층 · design_ids 로 서버 설계선 걷음(소스 확인 · typecheck 는 따로). +""" + +import json +from pathlib import Path +from uuid import uuid5 + +import ezdxf + +from B07_DesignDetail.B07_DesignDetail_Engine_Cad import ( + _POLY_NS, + CROSS_TABLE_LAYER_ID, + DESIGN_COLOR, + DESIGN_LAYER_ID, + DRAWING_FORMAT, + FRAME_LAYER_ID, + GROUND_COLOR, + GROUND_LAYER_ID, + ROCK_LAYER_ID, + STRUCTURE_LAYER_ID, +) +from B07_DesignDetail.B07_DesignDetail_Engine_Cad_Sheet import ( + STATION_LAYER_PREFIX, + build_cross_sheet, + plan_cross_sheets, +) +from B07_DesignDetail.B07_DesignDetail_Engine_Frame_Export import _layer_name, drawing_to_dxf +from B07_DesignDetail.B07_DesignDetail_Engine_Template import use_project_templates +from B07_DesignDetail.B07_DesignDetail_Router_Support import CROSS_SHEET_LAYOUT, _read_drawing + +ROOT = Path(__file__).resolve().parents[2] +KIND_LAYERS = {GROUND_LAYER_ID, DESIGN_LAYER_ID, STRUCTURE_LAYER_ID, ROCK_LAYER_ID} + + +def _source(chainage: float) -> dict: + return { + "chainage_m": chainage, + "samples": [ + {"valid": True, "offset_m": float(x), "elevation_m": 100.0 + 0.1 * x} + for x in range(-5, 6) + ], + } + + +def _sheet() -> tuple[dict, dict]: + use_project_templates(None) + chainages = [0.0, 20.0, 40.0, 60.0] + sheet = plan_cross_sheets(chainages, {"default": [2, 2]})[0] + sections = [ + { + "chainage": c, + "source": _source(c), + # 암 지반 = 암 경계선도 측점 층으로 + "design": {"rock_boundary_offset_m": -1.0} if c == 20.0 else None, + "design_line": [{"offset_m": x, "elevation_m": 100.0} for x in (-3.0, 0.0, 3.0)], + "quantity_table": {"ground": 1.0, "planned": 0.5}, + "title": f"No.{int(c // 20)}", + } + for c in chainages + ] + return sheet, build_cross_sheet(sheet, sections) + + +def _flat(entities: list[dict]) -> list[dict]: + out = [] + for entity in entities: + out.append(entity) + out.extend(_flat(entity.get("children") or [])) + return out + + +def test_측점마다_층_하나_이름_횡단_No(): + _sheet_, drawing = _sheet() + layers = drawing["layers"] + ids = [layer["id"] for layer in layers] + assert ids[:4] == [f"{STATION_LAYER_PREFIX}{c}" for c in (0.0, 20.0, 40.0, 60.0)] + assert [layer["name"] for layer in layers[:4]] == [ + "횡단 No.0", + "횡단 No.1", + "횡단 No.2", + "횡단 No.3", + ] + assert ids[4:] == [CROSS_TABLE_LAYER_ID, FRAME_LAYER_ID] + assert not KIND_LAYERS & set(ids) # 종류 층 없음 — 빈 층이 안 남음 + assert all(layer["isVisible"] and not layer["isLocked"] for layer in layers[:4]) + + +def test_그림은_측점_층_표_글은_수량표_층_격자는_도각(): + _sheet_, drawing = _sheet() + flat = _flat(drawing["entities"]) + assert not any(e["layerId"] in KIND_LAYERS for e in flat) # 자식 선까지 + by_layer: dict[str, list[dict]] = {} + for entity in drawing["entities"]: + by_layer.setdefault(entity["layerId"], []).append(entity) + for chainage in (0.0, 20.0, 40.0, 60.0): + members = by_layer[f"{STATION_LAYER_PREFIX}{chainage}"] + colors = {e["lineColor"] for e in members} + assert GROUND_COLOR in colors and DESIGN_COLOR in colors + assert all(e["type"] == "PolyLine" for e in members) + assert len({e["groupId"] for e in members}) == 1 # 180-1 groupId 그대로 + # 암 지반 측점만 점선 암 경계선(종류 = 선 꼴) + rock = [e for e in by_layer[f"{STATION_LAYER_PREFIX}20.0"] if e.get("lineDash")] + assert len(rock) == 1 + assert not any(e.get("lineDash") for e in by_layer[f"{STATION_LAYER_PREFIX}0.0"]) + assert {e["type"] for e in by_layer[CROSS_TABLE_LAYER_ID]} <= {"Table", "Text"} + assert all("groupId" not in e for e in by_layer[FRAME_LAYER_ID]) + + +def test_id_그대로_placement_layer_id_design_ids(): + sheet, drawing = _sheet() + by_id = {e["id"]: e for e in drawing["entities"]} + for placement in drawing["cross_placements"]: + chainage = placement["chainage_m"] + layer_id = f"{STATION_LAYER_PREFIX}{chainage}" + assert placement["layer_id"] == layer_id + seed = f"{sheet['id']}:{chainage}" + # 개체 id 는 종류 층 씨앗 그대로 — 저장본 · 덧그림 짝이 안 흔들림 + ground = by_id[str(uuid5(_POLY_NS, f"{seed}:{GROUND_LAYER_ID}"))] + assert ground["layerId"] == layer_id and ground["lineColor"] == GROUND_COLOR + design_ids = placement["design_ids"] + assert design_ids == [str(uuid5(_POLY_NS, f"{seed}:{DESIGN_LAYER_ID}"))] + assert all(by_id[i]["lineColor"] == DESIGN_COLOR for i in design_ids) + + +def test_DXF_층_이름_측점_층_id(tmp_path: Path): + _sheet_, drawing = _sheet() + for layer in drawing["layers"]: + assert _layer_name(layer["id"]) == layer["id"] + data, _skipped = drawing_to_dxf(drawing) + (tmp_path / "sheet.dxf").write_bytes(data) + names = {layer.dxf.name for layer in ezdxf.readfile(tmp_path / "sheet.dxf").layers} + assert {f"{STATION_LAYER_PREFIX}{c}" for c in (0.0, 20.0, 40.0, 60.0)} <= names + assert not KIND_LAYERS & names + + +def test_옛_확정_장_원지반_잠금_풂_측점_층_안내(tmp_path: Path): + stage = tmp_path / "B07_DesignDetail" + (stage / "drawings").mkdir(parents=True) + layers = [ + {"id": GROUND_LAYER_ID, "name": "원지반", "isVisible": True, "isLocked": True}, + {"id": FRAME_LAYER_ID, "name": "도각", "isVisible": True, "isLocked": True}, + ] + saved = {"format": DRAWING_FORMAT, "entities": [], "layers": layers} + path = stage / "drawings" / "cross_s00000m.json" + path.write_text(json.dumps(saved), encoding="utf-8") + entry = {"kind": "cross", "label": "1장", "confirmed": True, "layout": CROSS_SHEET_LAYOUT} + (stage / "manifest.json").write_text( + json.dumps({"drawings": {"cross_s00000m": entry}}), encoding="utf-8" + ) + + def read() -> dict: + _k, _l, drawing, confirmed, _t = _read_drawing( + tmp_path, tmp_path / "x.json", "cross_s00000m" + ) + assert confirmed + return drawing + + drawing = read() + locked = {layer["id"]: layer["isLocked"] for layer in drawing["layers"]} + assert locked == {GROUND_LAYER_ID: False, FRAME_LAYER_ID: True} # 도각은 그대로 잠금 + assert drawing.get("stale_layers") is True + # 측점 층으로 확정한 장은 안내 없음 + saved["layers"] = [{"id": f"{STATION_LAYER_PREFIX}0", "name": "횡단 No.0"}, layers[1]] + path.write_text(json.dumps(saved), encoding="utf-8") + assert "stale_layers" not in read() + + +def test_화면_덧그림_측점_층_design_ids(): + struct = (ROOT / "B07_DesignDetail/B07_DesignDetail_UI_Cad_Structures.ts").read_text( + encoding="utf-8" + ) + assert "layer_id?: string;" in struct and "design_ids?: string[];" in struct + assert "moveToLayer(entity, placement.layer_id)" in struct + assert "!designIds.has(entity.id as string)" in struct + page = (ROOT / "B07_DesignDetail/B07_DesignDetail_UI_Page.ts").read_text(encoding="utf-8") + assert "response.drawing.stale_layers" in page