Files
Aislo/resources/tester/test_509_2_sheet_grid.py
T
eomsangdonandClaude Opus 5.5 99ec4b8efe feat(B05 평면 지도): 공용 도구줄 표 · 겹 줄 · 범례 · 지형 칩 붙임 · 노선추천 = 도구줄 미리보기(넷 · 하나만 · 끔) · [적용] · 추천 모달 · 좌측 칸 걷음 · 지형 바꿈 = 지형 칩 (PLAN 624-3 · 626-1 · 요구 530 · 531)
- 624-3 도구줄 = 공용 표 「b05」 · 아래 줄 = 공용 겹 줄(띠 · 올린 임도망도 숨김 · 처음 = 등고선 · 하천) · 범례 = 공용 legendRows(상태 글판 위)
- 노선 띠 300 m 자르기 = B05 자기 칸(등고선 · 하천 · 1 m)만 · 그 밖 겹 = 안 자르는 둘째 GL 칸(맨 밑 · 켠 겹 있을 때만 · GL 만) · 등고선 끔 = 등고 글도 숨김
- 626-1 추천 보기 = 도구줄 아이콘 + 아래 판(영선 · 토공 최소 · 기울기 최소 · 비중 계산 · 끔) — route_recommend 저장본(지금 설계 지형) 선만 · 다시 셈 · 쓰기 없음
- 지형 칩 → 확인창 → 새 POST /route/design-terrain(설계 지형만 바꿈 · 노선 저장 체인 다시 · 노선 · 초기값 · 추천 저장본 그대로 · 잠금 · 실패 되돌림)
- 걷음 — 추천 모달(_Recommend · _Help · _Map · CSS) · 좌측 「노선 추천」 칸 · saveRecommendedRoute · UI_RouteReset(서버 as_initial 길 · 시험은 남김)
- 부품 상자 — createPickMenu(아이콘 고르기 메뉴 · 판 = body fixed · ✓)
- 낡은 시험 고침 · 지움 — 모달 · 좌측 칸 · [적용] 화면 배선을 보던 시험(283 · 346_3 · 349 · 364_4 · 383_1 · 390_5 · 418 · 421 · 421_2 · 476_2 · 509_2 · 509_5 · 551_2 · 600_3 · b05_routeedit_initial · design_view_parity · modal_top · 133_1 · 133_2) · test_508_2 · helper_283 지움(모달 전용)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 21:30:49 +09:00

57 lines
2.8 KiB
Python

"""509-2 수치지형도 격자 브라우저로 — 적용 지형(설계 지형) = 수치지형도일 때만 그 격자를 받음 · 노드
끌기 지반고 서버 묻기 걷음 · 횡단 비탈 넓힘도 같은 격자(509-4 G2).
./venv/Scripts/python.exe -m pytest resources/tester/test_509_2_sheet_grid.py -q
분석 지형 = 설계 지형 하나(509-5) — 받는 격자는 늘 설계 지형 것 · 추천 [적용]이 지형을 바꾸면 버림.
"""
from pathlib import Path
from B05_Profile.B05_Profile_Router_Terrain import _design_grid
from common_util.common_util_surface_confirmation import SHEET_ANALYSIS_FILTER
ROOT = Path(__file__).resolve().parents[2]
SHEET = {"source_filter": SHEET_ANALYSIS_FILTER, "method": "dtm", "smooth": True}
MODEL = f"B04_PreProcess/models/dtm_{SHEET_ANALYSIS_FILTER}.npz"
def test_설계_지형_수치지형도면_그_격자_자리(tmp_path) -> None:
grid = _design_grid(SHEET, tmp_path, (41, "dtm", MODEL))
assert grid == {"model_id": 41, "smooth": True, "signature": "."}
def test_확정_모델이_다른_파일이면_격자_없음(tmp_path) -> None:
las = "B04_PreProcess/models/dtm_classification.npz"
assert _design_grid(SHEET, tmp_path, (41, "dtm", las)) is None
assert _design_grid(SHEET, tmp_path, None) is None
def _ts(path: str) -> str:
return (ROOT / path).read_text(encoding="utf-8")
def test_지반고는_설계_지형_격자_서버_묻기_없음() -> None:
replan = _ts("B05_Profile/B05_Profile_Api_Replan.ts")
elevations = replan.split("export async function fetchRouteElevations", 1)[1][:700]
assert "if (local) {" in elevations # 받아 둔 격자면 늘 브라우저 표본
assert "JSON.stringify({ points })" in elevations # 서버 길도 설계 지형
# 계산 묶음 초안 지형 = null(설계) → ground 단계가 격자를 씀(terrain === null)
ground = _ts("B05_Profile/logic/B05_Profile_Pipeline_RouteGround.ts")
assert "(terrain === null || terrain === local.design)" in ground
pipeline = _ts("A00_Common/design/design_pipeline_page.ts")
assert "terrain: null };" in pipeline
# 횡단 비탈 넓힘 = ground 와 같은 격자(509-4 G2 · 적용 지형 것)
assert "createCrossStage({ grid: groundDeps.grid })" in pipeline
def test_적용으로_지형이_바뀌면_격자_버림() -> None:
grid = _ts("B05_Profile/B05_Profile_Api_TerrainGrid.ts")
forget = grid.split("export function forgetDesignTerrainGrid", 1)[1][:200]
assert "loaded.delete(projectId)" in forget and "ready.delete(projectId)" in forget
# 626-1 — 지형 바꿈 = 도구줄 지형 칩(옛 추천 [적용] 대신)
chip = _ts("B05_Profile/B05_Profile_UI_RouteEdit_Terrain.ts")
assert chip.index("forgetDesignTerrainGrid(projectId)") < chip.index(
"await rebuildAfterRouteSave(projectId)"
)