- 맞춤 규칙 한 벌 — common_util_structure_station(파이썬 · TS 짝 · 거울 시험) - 입력 — 좌측 폼 칸(1 m 단계 · 친 값만) · 끌기 · 우클릭 · 방향키(1 m 걸음) · 배수유역도 관 · B06 관 옮김 · 추가 - 구간형 시작 · 끝도 정수 m · 일반 측점 = 횡단 상세를 읽을 때 등록 - 서버 자동 배치 · 노선 재투영 자리도 정수 m(확정본은 단추로만) - [정수 맞춤] — 구조물 목록 머리 · 확인 창 · 관은 하나씩 폼 [수정] 길 · 계획고 편집 따라감 · 결과 n건 알림 - 찾는 폭 한 값 — 손으로 적은 0.51 을 PIPE_MATCH_M 으로 - 시험 — test_234_1 새로 · 1 m 걸음 · 정수 입력에 맞춘 기대값 고침(219_1 · station_roundtrip) · 헬퍼 대역 보탬 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01F3mdb91125mPoC6tpsQx4P
42 lines
2.3 KiB
TypeScript
42 lines
2.3 KiB
TypeScript
/* =============================================================================
|
|
* B05_Profile_UI_Drainage_Report.ts
|
|
* 배수유역 패널이 관 목록이 바뀔 때 밖에 알리는 **관 보고**(`DrainagePipeReport`)를 만든다.
|
|
* `B05_Profile_UI_Drainage_Panel` 에서 떼어냄(700줄 제한) — 셈은 그대로, 상태를 안 든다.
|
|
* ========================================================================== */
|
|
|
|
import type { DetailBasin, PipeSource } from "../B04_PreProcess/B04_PreProcess_Api_Fetch";
|
|
import type { createFacilityStore } from "./B05_Profile_UI_Drainage_Facility";
|
|
import type { DrainagePipeReport } from "./B05_Profile_UI_Drainage_Panel_Types";
|
|
import { PIPE_MATCH_M } from "../A00_Common/design/design_selection";
|
|
|
|
/** 관마다 담당 유역의 배수 유효직경을 붙인다(±0.5m 매칭). 유역 없는 관은 null.
|
|
* 세월교 검토 유역(bridge_required)도 null — 관 규격을 최대치로 올려 봐야 무의미하고,
|
|
* 그 지점은 세월교·물넘이로 별도 설계한다(임도설치규정 제12조).
|
|
* 시설 종류·구간·부속 옵션·출처(source)도 함께 — 통합 목록·사이드 폼이
|
|
* 이 목록만으로 편집 화면을 채운다(2026-08-17 단일 폼 통합). */
|
|
export function buildPipeReports(
|
|
pipes: ReadonlyArray<{ chainage_m: number; reason?: string }>,
|
|
basins: ReadonlyArray<DetailBasin>,
|
|
facilityStore: ReturnType<typeof createFacilityStore>,
|
|
): DrainagePipeReport[] {
|
|
return pipes.map((pipe) => {
|
|
const chainage = Math.round(pipe.chainage_m * 100) / 100;
|
|
const basin = basins.find((entry) => Math.abs(entry.chainage_m - chainage) < PIPE_MATCH_M);
|
|
const attributes = facilityStore.get(chainage);
|
|
return {
|
|
chainage_m: chainage,
|
|
effective_diameter_mm:
|
|
basin && !basin.bridge_required ? (basin.pipe_diameter_mm ?? null) : null,
|
|
// 설계유량은 세월교 검토 유역에도 붙인다 — 물넘이·세월교 단면이 이 값에서 나온다.
|
|
design_flow_m3s: basin?.design_flow_m3s ?? null,
|
|
facility: attributes?.facility ?? "pipe",
|
|
start_m: attributes?.start_m,
|
|
end_m: attributes?.end_m,
|
|
source: (pipe.reason || "user") as PipeSource,
|
|
options: attributes?.options,
|
|
summary_item: attributes?.summary_item,
|
|
group_items: attributes?.group_items,
|
|
};
|
|
});
|
|
}
|