- 세월교 명세(design_structure_ford) — 세월교(관경 · 월류 폭 · 월류 높이 · 수량(련)) · 유입 구조 · 유출 구조(없음 · 날개벽 · 흙막이) · 모두 필수 · 컨테이너마다 구조물 조합 잇기(gford · gfordin · gfordout) - 구조 키 inlet_type · outlet_type + 옛 날개벽 설치 칸(wing_in · wing_out) 함께 씀 · 옛 저장 · B06 조정창 설치 칸으로 구조를 맞춤 · 옛 관종 · 날개벽 치수는 지난 정의 값 - 계산 파일 따로(design_structure_ford_calc) — 높이 = 설계유량을 그 폭으로 넘기는 Manning 필요 수심 · 0.01 올림 · 폭을 바꾸면 채움 · 그 아래는 안 받음 · 근거 통수단면.md:23~33 · :59 - B06 날개벽 조정 행 자리 = 유입 · 유출 구조 컨테이너 끝 · 세월교 옛 관종 · 관경 · 월류 칸 걷음 - 정의 종류.ford_bridge.이름 표 · 명세 등록(STRUCTURE_SPECS) · 52-1 시험 헬퍼가 같은 폴더 명세 import 를 읽음 - 시험 test_52_4_structure_spec_ford · 화면 시나리오 ui_checks/52-4_세월교_컨테이너 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NPJGtfXo6GMbcpiboQC4uK
89 lines
3.5 KiB
TypeScript
89 lines
3.5 KiB
TypeScript
/* =============================================================================
|
|
* design_structure_ford.ts
|
|
* 횡단배수 › 세월교 명세 — 사용자 구조물 표 04(`docs/raw/구조물정의_표/04_횡단배수_세월교.md`) 그대로.
|
|
*
|
|
* 컨테이너 셋: 세월교(필수) · 유입 구조(필수) · 유출 구조(필수). 구조 · 정본 = 이 명세 · 이름만 정의(M02)에서 바꿈.
|
|
* 저장 키 = pipe_points.json 옛 키 그대로(B06 세월교 세트 · B07 · B08 이 읽는 자리) — 새 키 = 유입 · 유출 구조
|
|
* (`inlet_type` · `outlet_type` = 없음 · 날개벽 · 흙막이) · 고르면 옛 날개벽 설치 칸(`wing_in` · `wing_out`)도 함께 적음.
|
|
* 월류 높이 = 월류 폭과 연동(폭을 바꾸면 필요 수심으로 채움 · 그 아래로는 안 받음) — 계산은 `design_structure_ford_calc`.
|
|
* import 없음 — 시험이 이 파일만 옮겨 돌림.
|
|
* ========================================================================== */
|
|
|
|
import type { SpecContainer, SpecChoice, StructureSpec } from "./design_structure_spec";
|
|
|
|
/** 유입 · 유출 구조 — 날개벽만 옛 설치 칸이 「있음」. */
|
|
const guard = (side: "in" | "out"): SpecChoice[] => [
|
|
{ value: "없음", label: "없음", also: { [`wing_${side}`]: "없음" } },
|
|
{ value: "날개벽", label: "날개벽", also: { [`wing_${side}`]: "있음" } },
|
|
{ value: "흙막이", label: "흙막이", also: { [`wing_${side}`]: "없음" } },
|
|
];
|
|
|
|
const guardContainer = (id: "inlet" | "outlet", title: string, link: string): SpecContainer => ({
|
|
id,
|
|
title,
|
|
required: true,
|
|
link,
|
|
items: [
|
|
{
|
|
id: "structure",
|
|
label: "구조",
|
|
kind: "select",
|
|
key: `${id}_type`,
|
|
choices: guard(id === "inlet" ? "in" : "out"),
|
|
},
|
|
],
|
|
});
|
|
|
|
export const FORD_SPEC: StructureSpec = {
|
|
typeId: "ford_bridge",
|
|
containers: [
|
|
{
|
|
id: "ford",
|
|
title: "세월교",
|
|
required: true,
|
|
link: "gford",
|
|
items: [
|
|
{
|
|
id: "diameter",
|
|
label: "관경",
|
|
kind: "select",
|
|
key: "pipe_diameter_mm",
|
|
asNumber: true,
|
|
choices: ["800", "1000", "1200", "1500"].map((v) => ({ value: v, label: v })),
|
|
},
|
|
{ id: "width", label: "월류 폭 (m)", kind: "number", key: "ford_width_m", step: 0.1 },
|
|
{ id: "height", label: "월류 높이 (m)", kind: "number", key: "ford_height_m", step: 0.01 },
|
|
{ id: "count", label: "수량 (련)", kind: "number", key: "pipe_count", step: 1 },
|
|
],
|
|
},
|
|
guardContainer("inlet", "유입 구조", "gfordin"),
|
|
guardContainer("outlet", "유출 구조", "gfordout"),
|
|
],
|
|
// 표 04 에 없는 옛 칸 — 화면에서 빼고 값은 남김(지난 정의 값)
|
|
retired: [
|
|
"pipe_kind",
|
|
"wing_in_height_m",
|
|
"wing_in_length_m",
|
|
"wing_in_angle_deg",
|
|
"wing_out_height_m",
|
|
"wing_out_length_m",
|
|
"wing_out_angle_deg",
|
|
],
|
|
};
|
|
|
|
/** 구조를 날개벽 설치 칸(옛 저장 · B06 조정창이 고치는 칸)에 맞춤 — 있음 = 날개벽 · 없음 = 날개벽이면 없음
|
|
* (흙막이는 그대로) · 설치 칸이 없으면 구조 그대로. */
|
|
export function withLegacyGuards(
|
|
options: Record<string, string | number>,
|
|
): Record<string, string | number> {
|
|
const out = { ...options };
|
|
for (const [type, wing] of [
|
|
["inlet_type", "wing_in"],
|
|
["outlet_type", "wing_out"],
|
|
]) {
|
|
if (out[wing] === "있음") out[type] = "날개벽";
|
|
else if (out[wing] === "없음" && (out[type] ?? "날개벽") === "날개벽") out[type] = "없음";
|
|
}
|
|
return out;
|
|
}
|