- POST /api/projects/{id}/route/coords — 작업 좌표계(resolve_project_crs · WKT 그대로) pyproj 묶음 변환
- 찾기 이동 = 서버 변환 좌표 · 바탕 tm_grid 늘려 쓰기(ponytail) 걷음
- 키트 lonLat = 노드 고를 때 한 번 묻기 · 같은 점 캐시
- test_635_3 찾기 줄 = 서버 변환 부름으로 고침(옛 tm_grid 부름 걷힘)
- 실측 검증_sub6 B: 50.4 km · 181.2 km 찾기 이동 어긋남 0.000 m · 경위도 = pyproj
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
78 lines
4.4 KiB
Python
78 lines
4.4 KiB
Python
"""635-3 B05 왼쪽 「위치」 · 「그리기」 칸 · 「예정노선 수정」 · 받은 노선 비교 · [받은 노선으로] · 어둡게(요구 546).
|
|
|
|
- 칸 = 예정노선 키트(`createPlanKit` 「b05」) 칸 · 자리 = `registerPanelSection` order 1 · 2(종단 보기) · 편집기가 채움.
|
|
- 위치 = 찾기 → 지도 이동만(지형 받기 · 기준점 없음) · 고칠 선 = 받은 원본 꼭짓점(`GET /route/plan/source` · 635-2).
|
|
- [받은 노선으로] = 받은 꼭짓점 다시 추적 + 초안 `expected` [](고친 예정노선 지움) — 한 걸음 · 페이지 [초기화] 그대로.
|
|
- 켬 = 아래 계획노선 그림 불투명 `--draw-map-dim`(0.35) · 등고 높이값 · 예정노선 그림은 그대로.
|
|
- 큰 파일 안 늘림(RouteEdit 683 · Render 648 + 10 안).
|
|
|
|
./venv/Scripts/python.exe -m pytest resources/tester/test_635_3_b05_plan_panel.py -q
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import re
|
|
from pathlib import Path
|
|
|
|
ROOT = Path(__file__).resolve().parents[2]
|
|
B05 = ROOT / "B05_Profile"
|
|
|
|
|
|
def _src(path: Path) -> str:
|
|
return path.read_text(encoding="utf-8")
|
|
|
|
|
|
def test_왼쪽_칸_둘_종단_보기_위():
|
|
panel = _src(B05 / "B05_Profile_UI_Panel_Plan.ts")
|
|
assert '["site", 1, "위치"]' in panel and '["draw", 2, "그리기"]' in panel
|
|
assert 'views: ["profile"]' in panel and "id: `plan-${slot}`" in panel
|
|
assert "export function fillPlanPanel(" in panel
|
|
assert "holder.hidden = !card;" in panel # 비면 자리 숨김
|
|
# 다른 칸(구조물 배치 10 · 페이지 설정 20)보다 위
|
|
assert "order: 10" in _src(ROOT / "A00_Common" / "design" / "design_sections.ts")
|
|
assert "order: 20" in _src(B05 / "B05_Profile_UI_Panel_Sections.ts")
|
|
|
|
|
|
def test_키트_칸_위치_찾기_이동만_원본_꼭짓점():
|
|
ui = _src(B05 / "B05_Profile_UI_ExpectedDraw.ts")
|
|
body = ui.split("*/", 1)[1]
|
|
assert 'page: "b05",' in body and "cards: { site: { parts: [find.root] } }," in body
|
|
assert "fillPlanPanel({" in body and "createPlaceFind(" in body
|
|
assert "coords.toPlan(hit.lon, hit.lat)" in body # 지도 이동만(서버 변환 · 635-5)
|
|
for banned in ("createPlanTerrain", "ensureCovered", "createPlanSite", "createFloatPanel"):
|
|
assert banned not in body, banned
|
|
assert "/route/plan/source" in body and "expected_source" in body
|
|
assert "shown === original ? received() : shown" in body # 안 고친 선 = 원본 꼭짓점
|
|
features = _src(ROOT / "D03_PlanAnalysis" / "D03_PlanAnalysis_UI_Features.ts")
|
|
assert re.search(r'key: "site",[^}]*b05: "use"', features)
|
|
assert re.search(r'key: "terrain",[^}]*b05: "hide"', features, re.S)
|
|
|
|
|
|
def test_수정_켬끔_받은_노선_비교_되돌림():
|
|
body = _src(B05 / "B05_Profile_UI_ExpectedDraw.ts").split("*/", 1)[1]
|
|
assert 'label: "예정노선 수정"' in body and 'label: "받은 노선"' in body
|
|
assert "drawCard.firstElementChild!.append(toggle.root);" in body # 그리기 칸 머리
|
|
assert "event.stopPropagation()" in body # 켬끔 누름 = 칸 접기 아님
|
|
assert "받은 노선 ${meters(received())} m → 고친 노선 ${meters(line())} m" in body
|
|
assert 'label: "받은 노선으로"' in body and "follow(received(), [])" in body
|
|
assert "resetButton.disabled = !edited || busy;" in body
|
|
assert "if (!sameLine(points, base)) await follow(points, points);" in body
|
|
main = _src(B05 / "B05_Profile_UI_RouteEdit.ts")
|
|
assert "frame: () => ({ meta, setView: (next: ViewState) => (view = next) })," in main
|
|
assert len(main.splitlines()) <= 683
|
|
|
|
|
|
def test_켬_때_아래_노선_어둡게():
|
|
body = _src(B05 / "B05_Profile_UI_ExpectedDraw.ts").split("*/", 1)[1]
|
|
assert 'dim: () => (open ? parseFloat(themeColor("--draw-map-dim", "0.35"))' in body
|
|
theme = _src(ROOT / "ui_template" / "ui_template_theme.css")
|
|
assert "--draw-map-dim: 0.35;" in theme
|
|
render = _src(B05 / "B05_Profile_UI_RouteEdit_Render.ts")
|
|
dim = render.index("context.globalAlpha = dim;\n drawFootprint(")
|
|
labels = render.index("context.globalAlpha = 1; // 등고 높이값")
|
|
top = render.index("context.globalAlpha = 1;\n scene.overAll?.paint(context);")
|
|
assert dim < render.index("scene.underRoute?.(context);") < labels < top # 추천 보기도 어둡게
|
|
assert render.index("drawStructureMarks(context, scene, line, style);") < top
|
|
assert len(render.splitlines()) <= 658
|
|
assert "overAll: expectedDraw," in _src(B05 / "B05_Profile_UI_RouteEdit.ts")
|