- design_pipeline_page.ts 새 — 프로젝트마다 묶음 하나(종단도 dispose 때 버림) · route · ground(sub8) · follow · planline · profile · stations · footprint(sub6) 붙임 · cross · masshaul · haul · drainage 는 붙으면 한 줄 · 첫 계산은 처음 고칠 때 · 가게 stations · profile · footprint · generation - B05_Profile_UI_RouteEdit_Draft.ts 새 — 사진첩 감싸기(쌓기 · 되돌리기 · 다시하기 · 열 때로 = 초안 넘김 · 같으면 null) · 저장 안 한 초안 되살림 · RouteEdit.ts 는 줄 셋(700줄 안) - logic/B05_Profile_Pipeline_Grade.ts 새 — follow(관 · 구조물 좌표 · 계획고 옮김) · planline(저장 기준 · 초안이면 바뀐 구간만 새 지반 첫 계획선) · profile(buildAlignment) · routeRange · gradeRange — sub1 짝 부르기만 - design_profile — listed 를 design_profile_base.ts 로 나눔 · rebuild = pipelineGrade · render · 구조물 측점 = 다시 셈 · adoptPipeline(초안 동안 편집은 메모리만 · [저장]이 안 보냄) · pipelineSource - design_pipeline — input() · dispose() - 시험 test_346_1_pipeline_page 12 건(실제 단계 · 노선 1,078 m 점 옮김 23 ms · 늦은 응답 버림 · 초안 캐시 칸 살아남음) · popout 시험 문맥에 pipelineGrade 자리 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TteK8mfYZetk5P3bEZkyVZ
45 lines
2.3 KiB
TypeScript
45 lines
2.3 KiB
TypeScript
/* =============================================================================
|
|
* A00_Common/design/design_profile_base.ts
|
|
* 종단도 계획선 기준 = 측점 한 벌(서버 일반 + 지금 구조물 측점 · 272) — `design_profile` 에서 나눔(700줄).
|
|
* 계산 묶음 planline 단계(`design_pipeline_page`)도 같은 기준을 받음.
|
|
* ========================================================================== */
|
|
|
|
import type { SectionDetailResponse } from "../../B06_Section/B06_Section_Api_Fetch";
|
|
import type { AlignmentBase } from "../../B05_Profile/B05_Profile_UI_Profile_Alignment";
|
|
import type { IrregularStation } from "../../B05_Profile/B05_Profile_UI_IrregularStations";
|
|
import {
|
|
irregularGraphStations,
|
|
maxChainageOf,
|
|
} from "../../B05_Profile/B05_Profile_UI_Profile_Layout";
|
|
import { followMovedNodes, oneStationList } from "../../common_util/common_util_structure_station";
|
|
|
|
/** 계획선 측점 줄 = 측점 한 벌(서버 일반 + 지금 구조물 측점 · 272) — 표 · ▲▼ · 그래프 · 3D · 횡단 다시 셈(342-1)이
|
|
* 같은 목록 · 사라진 구조물 측점의 꼭짓점은 서버와 같게 옮기거나 지움(`followMovedNodes`) · 늘 저장분에서 셈. */
|
|
export function listedBase(
|
|
storedBase: AlignmentBase | null,
|
|
detail: SectionDetailResponse | null,
|
|
irregularStations: IrregularStation[],
|
|
): AlignmentBase | null {
|
|
if (!storedBase || !detail) return storedBase;
|
|
const server = detail.longitudinal.stations;
|
|
const planted = irregularGraphStations(irregularStations, maxChainageOf(detail.longitudinal));
|
|
const list = oneStationList(server, planted);
|
|
const after = new Set(list.map((station) => station.chainage_m.toFixed(3)));
|
|
const before = new Set(server.map((station) => station.chainage_m.toFixed(3)));
|
|
const gone = server
|
|
.filter((station) => station.kind === "irregular" && !station.grid)
|
|
.map((station) => station.chainage_m)
|
|
.filter((chainage) => !after.has(chainage.toFixed(3)));
|
|
const born = list
|
|
.map((station) => station.chainage_m)
|
|
.filter((chainage) => !before.has(chainage.toFixed(3)));
|
|
return {
|
|
...storedBase,
|
|
basePvi: followMovedNodes(storedBase.basePvi, gone, born),
|
|
stations: list.map((station) => ({
|
|
station_id: station.station_id,
|
|
chainage_m: station.chainage_m,
|
|
})),
|
|
};
|
|
}
|