/* ============================================================================= * B06_Section_Section_Adjusts.ts * 저장 안 한 조정창 값(세션 · 측점 누가거리 열쇠)을 상세 설계 칸에 얹음 — 상세 가게가 읽을 때 한 번(387-4). * * 조정창(`_UI_Page_Station_Controls` · `_Ford_Controls` · `_Span_Control`)이 고칠 때 캐시에 얹는 것과 같은 * 칸 · 같은 꼴. 예전에는 고칠 때만 얹어 새로고침 · B05 만 연 페이지는 세션 값을 몰랐음 — 카드 그리기가 면적을 * 고쳐 들어 B06 을 연 뒤에만 면적이 바뀜(B05 만 연 면적 ≠ B06). 조정창은 세션 → 설계 순으로 읽으니 겹쳐도 같음. * * 관 옵션(폼 칸 · 관 초안 ?? 저장 관)의 조정값 몫도 여기서(387-4b · `layPipeOptions`) — 관 벽 높이 · 형태(h · m) · * 흙막이 n 단(h · m · 구간). 예전에는 B06 보기가 열릴 때 폼이 되보내야만 얹혀 B05 만 연 면적이 달랐음. * 형상(관 세트 · 흙막이 세트 · 도수로 · 세월교 · BOX 제원)은 형상 얹기(`attachShapes`)가 이미 함. * 같은 규칙 = `B06_Section_UI_Page_Pipe_Options`(폼을 고친 그 자리 즉시 반영 몫). * ========================================================================== */ import { readState } from "../A00_Common/b_page_state"; import type { SectionDetailResponse } from "./B06_Section_Api_Fetch"; import { readBermDepths, readShoulderExtends } from "./B06_Section_Cross_Design_Session"; import { layCarriedEdits, layDraftAdjusts, layPipeOptions, type Cells, type OptionPipe, } from "./B06_Section_Route_Carry_Patch"; // 얹기 몸통 = `B06_Section_Route_Carry_Patch` 한 벌(서버 노선 바뀐 [저장] 넘김도 · 472-6) — 여기는 세션 겉. export { layPipeOptions, type OptionPipe }; export function withDraftAdjusts( detail: SectionDetailResponse, projectId: string, routeId: number, ): void { layDraftAdjusts(detail, (name) => readState(name as never, projectId, routeId) ?? {}); } /** 노선 저장 뒤 새 노선으로 옮긴 세션 고침(417) — 사면 쉬프트 · 소단 깊이 · 측점 폭 · 메모 · 상세 표를 설계 칸에 얹음 · * 같은 [저장]의 횡단 패치(`crossPatchesFromCache`)가 실음. 조절 4축 · 형식은 `withDraftAdjusts`. */ export function withCarriedEdits( detail: SectionDetailResponse, projectId: string, routeId: number, ): void { layCarriedEdits(detail, (name) => readState(name as never, projectId, routeId) ?? {}, { shoulder: readShoulderExtends(projectId, routeId), berm: readBermDepths(projectId, routeId), }); } /** 관 옵션 조정값 몫 얹기(387-4b) — 관 초안 ?? 저장 관(페이지 자료 줄). 가게 · 자료 줄은 부를 때 늦게 불러옴 — * 이 파일을 끄는 시험 · 묶음이 그 줄기(fetch · 가게)를 안 끌게. 못 받으면 그대로. * `reshape` = 관 제원도 형상 얹기 규칙으로 다시(다시 셈 창구 앞 · B06 폼 되보내기가 옵션 값을 제원에 그대로 * 써 넣어 최소 높이 · 집수정 쪽 칸이 서버와 갈림 — 집수정 높이 1.5 ↔ 2 등). */ export async function withPipeOptions( detail: SectionDetailResponse, projectId: string, reshape = false, ): Promise { if (reshape) await import("./B06_Section_Section_Drafts") .then(({ withDraftShapes }) => withDraftShapes(detail, projectId)) .catch(() => undefined); const pipes = await import("../B05_Profile/B05_Profile_Api_Pipes_Draft") .then( async ({ readPendingPipes }) => readPendingPipes(projectId) ?? (await import("../A00_Common/design/design_page_data")) .pagePipes(projectId) .then((res) => res.pipe_points), ) .catch(() => null); if (pipes) layPipeOptions(detail, pipes as OptionPipe[]); }