- `design_pipe_ids.ts` — 장부(세션 pipe-ids) · pipe-s{차례} · 자리 → id(찾는 거리 안 가장 가까운 것) · followMovedPipe 가 id 를 새 자리로(고름 id 그대로 · 순환 import 없게 design_selection 에서 옮김) · 설계 페이지가 프로젝트를 정함(usePipeIds) · 자리 이름 만들기 열 곳 · 되읽기 둘 걷음 · 측점 계획 주인 = 세션 id(withPipeIds)
- `design_pick_match.ts` — pickLights(① id ② 같은 자리 ③ 고른 부분) · paintPicked(카드 통째 형상 · 부분 · 관 계열 · 포장층은 제 손잡이) · tagShape — 관 세트 벽 · 집수정 · 관 · 세월교 측벽 · 몸체 · BOX 끝 · C군 벽 · 물넘이 콘크리트에 신원표 · 형상 판정면은 통째 형상 · 콘크리트만
- 3D — 부재 맞춤 = pickLights(옛 0.01 걷음) · C군 벽 솔리드 = 구조물 id(덮는 측점 어디서 골라도 한 번 스윕한 벽이 켜짐)
- 322-0 이 깬 것 고침 — 노면공 흐름 도움 파일(165 · 231-1) 정의 판 확인 흉내 · design_view_profile 700줄(322-0 이 704)
- 시험: test_323_5_pick(세션 id · 옮김 · 강조 규칙 · 칠하기) · 옛 시험 도움 파일 흉내 · 기대 글 고침
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ji4nuyLVHcxrXWHTdb5nRD
45 lines
2.3 KiB
TypeScript
45 lines
2.3 KiB
TypeScript
/* =============================================================================
|
|
* A00_Common/design/design_structure_status.ts
|
|
* 구조물 현황 한 벌(322-3) — 저장분 둘(관 `pipe_points.json` · 구조물 `structures.json`) + 초안 둘(세션)
|
|
* → 한 목록(초안이 있으면 초안 · 없으면 저장분 · 종류마다 따로) · 측점 계획 한 벌(`planStations`) →
|
|
* 종단 측점 목록(B05 종단 · 3D 막대 · B06 종단 띠가 같은 꼴).
|
|
*
|
|
* 구조물 id = 구조물은 structure_id · 관은 세션 id(`design_pipe_ids` · 323-5 · 파일 모양 그대로 · 저장 안 함).
|
|
* ========================================================================== */
|
|
|
|
import type { IrregularStation } from "../../B05_Profile/B05_Profile_UI_IrregularStations";
|
|
import type { PlannedStation } from "../../common_util/common_util_structure_station";
|
|
|
|
/** 현황 — 종류마다 초안이 앞섬(초안 null = 만진 적 없음 · 빈 목록 = 다 지움). */
|
|
export function structureStatus<P, S>(
|
|
saved: readonly [ReadonlyArray<P>, ReadonlyArray<S>],
|
|
drafts: readonly [ReadonlyArray<P> | null, ReadonlyArray<S> | null],
|
|
): { pipes: P[]; structures: S[] } {
|
|
return { pipes: [...(drafts[0] ?? saved[0])], structures: [...(drafts[1] ?? saved[1])] };
|
|
}
|
|
|
|
/**
|
|
* 측점 계획 → 종단 측점(측점번호 · 잔여거리 = 간격 기준) — 기준 측점 id = 첫 주인 id(관 = `pipe-…` ·
|
|
* 구조물 = structure_id) · 시작 · 끝 = `{id}:{역할}`(옮겨도 계획고 편집이 따라감 · 272) · 관 기준 측점 =
|
|
* 「배관」 꼴(관 끌기 · 지우기 길).
|
|
*/
|
|
export function plannedIrregular(
|
|
planned: ReadonlyArray<PlannedStation>,
|
|
intervalM: number,
|
|
): IrregularStation[] {
|
|
const interval = intervalM > 0 ? intervalM : 20;
|
|
return planned.map((station) => {
|
|
const owner = station.owners[0];
|
|
const pipe = owner.startsWith("pipe-") && station.role === "anchor";
|
|
const number = Math.floor(station.chainage_m / interval);
|
|
return {
|
|
id: station.role === "anchor" ? owner : `${owner}:${station.role}`,
|
|
station: number,
|
|
remainder: station.chainage_m - number * interval,
|
|
chainage_m: station.chainage_m,
|
|
structure: station.title,
|
|
...(pipe ? { structureType: "배관" as const, origin: "pipe" as const } : {}),
|
|
};
|
|
});
|
|
}
|