diff --git a/B05_Profile/B05_Profile_UI_Structures_Panel.ts b/B05_Profile/B05_Profile_UI_Structures_Panel.ts index 892cde77..fabeafe0 100644 --- a/B05_Profile/B05_Profile_UI_Structures_Panel.ts +++ b/B05_Profile/B05_Profile_UI_Structures_Panel.ts @@ -21,98 +21,33 @@ import { type StructurePlacement, type StructureType, } from "./B05_Profile_Api_Structures"; -import type { PipeFacility, PipeSource } from "../B04_PreProcess/B04_PreProcess_Api_Fetch"; -import { - type FacilityAttributes, - type FacilityOptionsForm, -} from "./B05_Profile_UI_Drainage_Facility"; +import type { PipeFacility } from "../B04_PreProcess/B04_PreProcess_Api_Fetch"; +import { type FacilityAttributes } from "./B05_Profile_UI_Drainage_Facility"; import { field, numberInput, select } from "./B05_Profile_UI_Structures_Fields"; import { buildStructuresForm } from "./B05_Profile_UI_Structures_Form"; +import { + bindStructuresEvents, + type StructuresEventContext, +} from "./B05_Profile_UI_Structures_Panel_Events"; +import { + commit as commitInto, + emit as emitFrom, + loadForm as loadFormInto, + loadPipeForm as loadPipeFormInto, +} from "./B05_Profile_UI_Structures_Panel_Commit"; import { renderStructureList } from "./B05_Profile_UI_Structures_List"; -import { splitPavementRange } from "./B05_Profile_UI_Structures_Pavement"; import { formatStation } from "./B05_Profile_Util_Station"; -/** 구조물군 표시 이름. 리스트 기호(A~G)만으로는 무엇인지 알기 어렵다. - * 우클릭 메뉴(종단그래프·배수유역도)도 같은 이름을 쓴다(2026-08-18 일원화). */ -export const GROUP_LABELS: Record = { - A: "A 횡단배수", - B: "B 종단배수", - C: "C 사면안정", - D: "D 계류·사방", - E: "E 안전·부대·용지", - F: "F 생태·녹화", - G: "G 노면공", - 호환: "기타", -}; - -/** 구간형 신규 추가 시 기본 구간 길이(m). 사용자가 종점을 바로 고칠 수 있게 짧게 잡는다. */ -const DEFAULT_INTERVAL_LENGTH_M = 15; - -/** 계곡 통과 시설 1건 — 관 지점 정본에서 온 병합 표시·폼 편집용 항목. */ -export interface PipeFacilityItem { - chainage_m: number; - facility: PipeFacility; - start_m?: number; - end_m?: number; - /** 자동 배치 출처(stream/spacing/user) — 배관 유형(계곡부형/보완형) 제안 근거. */ - source?: PipeSource; - /** 담당 유역의 설계유량(㎥/s) — 물넘이·세월교 개략 단면 계산의 입력. */ - design_flow_m3s?: number | null; - /** 부속 옵션(유형·집수정·기슭막이·돌붙임·날개벽·세월교 관 등). */ - options?: Record; -} - -export interface StructuresSection { - root: HTMLElement; - /** 계곡 통과 시설 부속 옵션 서브폼 — B06이 조정창 행을 이 폼의 유입구·유출구 - * 그룹으로 옮겨 붙이고 유입측 형식을 맞춘다(2026-08-29 일원화). */ - facility: FacilityOptionsForm; - /** 배치된 구조물 목록(