refactor(472-4 ① 추가 측점 따라감): 서버 추가 측점 따라감도 TS 한 벌 — followPlusRows · Node 입구 facility.plus_follow

- common_util_route_follow.ts followPlusRows(땅 위 자리 → 새 노선 정수 m · 같은 m 하나) · followPlusStations 가 그것을 씀
- Plus_Stations.follow_plus_stations = run_calc 겉(옮긴 수 · 쓰기 그대로) · follow_structures 끌림 걷음
- 등록부 node:facility.plus_follow · NODE_IDS · 시험 test_472_4_follow_node(옛 코드 빨강) · 368_2 · 459 통과

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-19 09:37:00 +09:00
co-authored by Claude Opus 5.5
parent cca08daa11
commit 39adebdaf5
7 changed files with 90 additions and 32 deletions
@@ -5,15 +5,22 @@
*
* profile.seat 입력 seat { ground_s · ground_z(저장 선형 표본) · policy(파이썬 `AlignmentPolicy.as_dict`) ·
* base_pvi(옮기기 전) · base(옮긴 꼭짓점) · born · held } → 꼭짓점 목록(`seatBornNodes`)
* facility.plus_follow 입력 plus { rows: [{ chainage_m · x · y }] · line: [[x, y]](새 노선) } →
* { rows: [{ chainage_m · x · y }](`followPlusRows` · 정수 m · 같은 m 하나) · moved: 옮긴 수 }
* ========================================================================== */
import { seatBornNodes } from "../../../B05_Profile/logic/B05_Profile_Grade_Seat";
import { followPlusRows, followStructures } from "@util/common_util_route_follow";
import type {
AlignmentNode,
AlignmentPolicy,
} from "../../../B05_Profile/logic/B05_Profile_UI_Profile_Alignment";
type Line = Array<[number, number]>;
const xyOf = (line: Line) => line.map(([x, y]) => ({ x, y }));
export interface FollowInputs {
plus?: { rows: Array<{ chainage_m: number; x?: number | null; y?: number | null }>; line: Line };
seat?: {
ground_s: number[];
ground_z: number[];
@@ -39,5 +46,19 @@ export function followRunners(inputs: FollowInputs): Record<string, () => unknow
};
return seatBornNodes(base, seat.base, seat.born, seat.held ?? []);
},
"facility.plus_follow": () => {
const plus = inputs.plus;
if (!plus) return null;
const line = xyOf(plus.line);
const moved = followStructures(plus.rows, line).filter(
({ item }, index) => item.chainage_m !== plus.rows[index].chainage_m,
).length;
const rows = followPlusRows(plus.rows, line).map(({ chainage_m, x, y }) => ({
chainage_m,
x: x ?? null,
y: y ?? null,
}));
return { rows, moved };
},
};
}
@@ -479,12 +479,11 @@ export const CALC_REGISTRY: readonly CalcEntry[] = [
outputs: ["추가 측점(input.plusStations 고침)"],
site: "browser_now",
stage: "follow",
ts: `${B05}B05_Profile_Api_PlusStations.ts#followPlusDraft`,
runner: `py:${B05}B05_Profile_Plus_Stations.py#follow_plus_stations`,
until: "472-4",
pair: `${B05}B05_Profile_Plus_Stations.py#follow_plus_stations`,
mirror: ["test_459_route_seat_mirror"],
note: "TS 가 Api 파일 안 — logic 으로(472-4 ①)",
ts: `${U}common_util_route_follow.ts#followPlusRows`,
runner: "node:facility.plus_follow",
pair: null,
mirror: ["test_459_route_seat_mirror", "test_368_2_plus_stations", "test_472_4_follow_node"],
note: "파이썬 `Plus_Stations.follow_plus_stations` = Node 부름 겉(정본 파일 읽기 · 쓰기)",
},
{
id: "facility.stations",