- design_page_data 새로 — 저장분(구조물 · 관 · 정의 판 확인) 페이지에서 한 번 · 저장 정본 바뀜(invalidate) · 페이지 떠남에 비움 · 보기 전환 요청 0 - 묶음 · 두 보기 구조물 칸 · 초안 측점이 같은 줄 · 「계산 중」 점(도크 · 묶음 차례 동안) - 묶음 planline 저장 기준 = 입력(관 · 구조물)이 심는 측점(design_pipeline_base · 페이지가 옵션으로) · baseMoved 지움 · 종류 한 벌 - design_pipeline_page 700줄 앞 쪼갬(design_pipeline_page_types) - 시험 test_384_2 · test_384_3 · 엄격 흉내 helper 에 자료 줄 더함 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TteK8mfYZetk5P3bEZkyVZ
37 lines
2.3 KiB
TypeScript
37 lines
2.3 KiB
TypeScript
/* =============================================================================
|
|
* A00_Common/design/design_pipeline_base.ts
|
|
* 묶음 planline 의 저장 노선 종단 기준(PLAN 386-3) — 측점 한 벌을 묶음 입력(관 · 구조물)으로 셈.
|
|
*
|
|
* 종단도 `listed()`(design_profile)와 같은 셈 — 저장 상세 측점 + 구조물 · 관이 심는 측점(`listedBase`).
|
|
* 심는 측점 = 종단 보기 구조물 칸(`syncCrossDrainStations`) · 횡단 보기(`planMarkStations`)와 같은
|
|
* `planStations` → `plannedIrregular` — 보기가 종단도에 늦게 심어도 묶음은 다시 안 돎(옛 `baseMoved` 지움).
|
|
* 종류 = 구조물 정의 전부(보기와 같음). 화면 모듈을 끌어 묶음 대신 페이지(`design_shared`)가 옵션으로 넘김.
|
|
* ========================================================================== */
|
|
|
|
import { listedBase } from "./design_profile_base";
|
|
import { plannedIrregular } from "./design_structure_status";
|
|
import { withPipeIds } from "./design_pipe_ids";
|
|
import { planStations, type PlanType } from "../../common_util/common_util_structure_station";
|
|
import type { PipelineInputs } from "./logic/design_pipeline_types";
|
|
import { readAlignment } from "../../B05_Profile/logic/B05_Profile_UI_Profile_Data";
|
|
import {
|
|
toAlignmentBase,
|
|
type AlignmentBase,
|
|
} from "../../B05_Profile/logic/B05_Profile_UI_Profile_Alignment";
|
|
import type { SectionDetailResponse } from "../../B06_Section/B06_Section_Api_Fetch";
|
|
|
|
/** 저장 상세(종단도가 그리는 것) + 지금 입력이 심는 측점 = 저장 노선 종단 기준. 상세가 없으면 종단도 기준. */
|
|
export function plantedBase(
|
|
source: { base: AlignmentBase | null; detail?: SectionDetailResponse | null },
|
|
inputs: Pick<PipelineInputs, "pipes" | "structures">,
|
|
types: ReadonlyArray<PlanType>,
|
|
): AlignmentBase | null {
|
|
const detail = source.detail ?? null;
|
|
const stored = detail && readAlignment(detail.longitudinal);
|
|
if (!detail || !stored) return source.base;
|
|
const pipes = withPipeIds((inputs.pipes ?? []) as Array<{ chainage_m: number }>);
|
|
const structures = (inputs.structures ?? []) as Parameters<typeof planStations>[1];
|
|
const planted = plannedIrregular(planStations(pipes, structures, types), 20); // 간격 = 이름 몫 · 기준 무관
|
|
return listedBase(toAlignmentBase(stored), detail, planted);
|
|
}
|