diff --git a/B06_Section/B06_Section_Router_Design.py b/B06_Section/B06_Section_Router_Design.py index e6b84416b..08b3d819b 100644 --- a/B06_Section/B06_Section_Router_Design.py +++ b/B06_Section/B06_Section_Router_Design.py @@ -4,6 +4,7 @@ """ import json +import re from pathlib import Path from typing import Any @@ -112,14 +113,17 @@ STRUCTURE_ADJUST_KEYS = ( # 노선 [확인] 체인이 옛 노선에서 누가거리로 넘기는 **사용자 입력**(PLAN 74-3) — 계획고 · 면적 · # design_line · road_edges 같은 결과 칸과 단면 유형 · 측구 방향(새 노선 지형이 정함) · 구조물 # 조작값은 넘기지 않는다. 받는 쪽은 `compute_default_designs(carried=…)`. -CARRY_INPUT_KEYS = ( - "ground_type", - "ditch_type", - "ditch_choice", - "two_stage_slope", - "rock_boundary_offset_m", - "cut_slope_ratio_user", - "berm", +# 칸 목록 정본 = TS `ROW_CARRY_KEYS`(logic/B06_Section_Station_Swap.ts) — 그 글을 읽음(472-4 ① X6). +_SWAP_TS = Path(__file__).resolve().parent / "logic" / "B06_Section_Station_Swap.ts" +CARRY_INPUT_KEYS: tuple[str, ...] = tuple( + re.findall( + r'"([a-z_0-9]+)"', + re.search( + r"export const ROW_CARRY_KEYS = \[(.*?)\] as const;", + _SWAP_TS.read_text(encoding="utf-8"), + re.S, + ).group(1), + ) ) diff --git a/B06_Section/logic/B06_Section_Station_Swap.ts b/B06_Section/logic/B06_Section_Station_Swap.ts index 0c87930ba..897bbc320 100644 --- a/B06_Section/logic/B06_Section_Station_Swap.ts +++ b/B06_Section/logic/B06_Section_Station_Swap.ts @@ -78,7 +78,8 @@ const FACILITY_RESEED_M = 0.5; /** 다시 셈 입력 중 새 지형이 정하는 칸 — 옮긴 시설 측점은 버림(단면 유형은 기본 설계 · 서버 `CARRY_INPUT_KEYS` 밖). */ const AUTO_INPUT_KEYS = ["ditch_side", "ditch_enabled"]; /** - * 옮긴 측점이 들고 가는 사용자 입력(445 H2) — 서버 `CARRY_INPUT_KEYS` 짝(노선 [확인] 이월과 같은 칸). + * 옮긴 측점이 들고 가는 사용자 입력(445 H2) — 목록 정본 = 여기 하나 · 서버 `CARRY_INPUT_KEYS` 가 이 글을 읽음 + * (노선 [확인] 이월과 같은 칸 · 472-4 ① X6 · 선언 꼴 그대로 둠 — 따옴표 글 목록 + `as const`). * 서버에 그 자리 행이 없으면(옮김 · 새 측점) [저장] patch 가 캐시 설계의 이 칸을 실음. */ export const ROW_CARRY_KEYS = [ diff --git a/resources/tester/test_472_station_user_fields.py b/resources/tester/test_472_station_user_fields.py index 49f9843b1..3138287b6 100644 --- a/resources/tester/test_472_station_user_fields.py +++ b/resources/tester/test_472_station_user_fields.py @@ -6,7 +6,7 @@ `pavement_*`(포장 제안 표기)가 사라짐(검증_sub8 측점 351). 고침 — 같은 자리(누가거리) 옛 줄에서 `STATION_CARRY_KEYS` 를 들고 감 · 사용자 상단측은 새 자동값을 이김 · 옛 줄 없는 새 자리는 포장 표기를 지금 계획선으로 셈. -X6 — 옮긴 측점이 들고 가는 횡단 입력 TS `ROW_CARRY_KEYS` = 파이썬 `CARRY_INPUT_KEYS`(거울). +X6 — 옮긴 측점 횡단 입력 = TS `ROW_CARRY_KEYS` 하나 · 파이썬 `CARRY_INPUT_KEYS` 는 그 글을 읽음. ./venv/Scripts/python.exe -m pytest resources/tester/test_472_station_user_fields.py -q """ @@ -124,7 +124,11 @@ def test_새_자리는_포장_표기를_지금_계획선으로(tmp_path) -> None def test_X6_옮긴_측점_횡단_입력_TS_파이썬_한_벌() -> None: + """목록 정본 = TS `ROW_CARRY_KEYS` 하나 · 파이썬은 그 글을 읽음(손으로 맞춘 목록 둘 없음).""" source = (ROOT / "B06_Section/logic/B06_Section_Station_Swap.ts").read_text(encoding="utf-8") body = re.search(r"export const ROW_CARRY_KEYS = \[(.*?)\] as const;", source, re.S) assert body is not None assert tuple(re.findall(r'"([a-z_0-9]+)"', body.group(1))) == CARRY_INPUT_KEYS + assert len(CARRY_INPUT_KEYS) == 7 and "berm" in CARRY_INPUT_KEYS + design = (ROOT / "B06_Section/B06_Section_Router_Design.py").read_text(encoding="utf-8") + assert "CARRY_INPUT_KEYS = (" not in design # 파이썬에 목록 글 없음