feat(B05): 노선 [확인] 때 고른 분석 지형 = 설계 지형 — 종 · 횡단 · 배수 · 유토 · 3D 전부 그 지형으로(133-2)

- [확인] 이 고른 지형으로 확정 모델 · stage 1 params 를 바꾼 뒤 재계산 체인을 돎(switch_design_terrain · B04 확정 표시도 따라감) · 체인 실패면 노선과 함께 되돌림
- 수치지형도로 갈 때 라이다 확정값을 stage 1 params 에 적어 둠 — 라이다로 되돌려 [확인]하면 원래 모델 · params
- 지형만 바꿔도 [확인]이 다시 셈 · 고르기 안 보이면(라이다 없는 프로젝트) 지형 안 실음 · 고른 값 없으면 지금 설계 지형 · 상태줄에 설계 지형 표시
- 분석 통로 terrain 기본 = 지금 설계 지형(None) · terrain-sources 가 design 을 함께 냄
- B06 구조물 측점 추가가 노선 확정 때 남긴 sampling.json 이 지금 지형과 다르면 stage 1 params 로 뜸(B04 재확정 때도 옛 지형으로 뜨던 흠)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UoSr2sqvYtBf1dtQdus88s
This commit is contained in:
2026-10-09 10:00:18 +09:00
co-authored by Claude Opus 5.5
parent 262f6d387e
commit e629584223
11 changed files with 446 additions and 35 deletions
+33
View File
@@ -10,7 +10,13 @@ from B04_PreProcess.B04_PreProcess_Repository import (
list_surface_models,
)
from common_util.common_util_surface_confirmation import (
LAS_STASH_KEY,
AnalysisTerrain,
analysis_terrain_params,
design_terrain,
get_surface_confirmation_params,
merge_surface_confirmation_params,
terrain_changes,
)
from common_util.common_util_workflow_state import complete_stage
@@ -52,3 +58,30 @@ async def confirm_surface_selection(
async with connection.cursor() as cursor:
await complete_stage(cursor, str(project_id), 1)
return normalized
async def switch_design_terrain(
connection: aiomysql.Connection,
project_id: UUID,
terrain: AnalysisTerrain | None,
) -> tuple[int, AnalysisTerrain] | None:
"""노선 [확인] 때 고른 분석 지형을 설계 지형으로(PLAN 133-2) — 확정 모델 · stage 1 params.
뒤 단계(종 · 횡단 · 배수 · 유토 · 3D)는 모두 stage 1 params · 확정 모델을 읽으므로 여기 한 곳만
바꾼다. 수치지형도로 갈 때 라이다 확정값을 적어 둠(되돌릴 자리). WF1 완료 전이는 안 건드림.
바뀌면 (새 확정 모델 id, 이전 설계 지형) · 그대로면 None. 트랜잭션은 부르는 쪽.
"""
params = await get_surface_confirmation_params(connection, str(project_id))
target = analysis_terrain_params(params, terrain)
if not terrain_changes(params, target):
return None
model_id = await find_surface_model_for_selection(connection, project_id, target)
await confirm_surface_model(connection, project_id, model_id)
previous = design_terrain(params)
extra = (
{LAS_STASH_KEY: {key: params[key] for key in ("source_filter", "method", "smooth")}}
if previous == "las"
else None
)
await merge_surface_confirmation_params(connection, str(project_id), target, extra)
return model_id, previous