Files
Aislo/B05_Profile/B05_Profile_UI_IrregularStations.ts
T
eomsangdonandClaude Opus 5.5 2da632dc45 refactor(B05·B06): 부름 0 옛 줄 · 늘 건너뛰는 시험 지움 (PLAN 472-8 ② ③ · 요구 409)
지움
- flushDesignStore(design_store · 부름 0) — 시험 344-4 의 flush 대조 한 줄도
- b_page_state 옛 세션 열쇠 옮김(legacy · migrate) · b_project_switch 옛 키 머리
  — 옛 열쇠는 세션 저장소(탭 닫으면 사라짐) · 지금 코드가 안 씀 · storage · DB 에 없음
  · 시험 290-1 · 401 · 384-1 의 옛 키 줄 뺌
- 시험만 부르던 TS — planFootprint(346-2 거울은 footprintRecord + slopePieces 로 그대로)
  · shiftSegment · shiftMovingPoints(쉬프트 단추는 09-02 지움 · min_cover_guard 쉬프트 시험 뺌)
  · dropStationsNear(test_b05_station_merge.mjs 지움) · createIrregularStationsSection(부름 0)
  · generalStations(234-1 은 기본 맞춤 값으로 같은 것 잼) · sameSummaryItem
- test_b05_b06_save_roundtrip + helper_b05_save_payload 둘 — 프로젝트 936be972 storage 없어 늘 skip
  · 같은 저장 왕복은 test_472_6_design_save(창구 원자성) · test_449_save_pipes(관 PUT)
    · test_238_1_save_keeps_structure_stations(구조물 측점)가 잼

남김
- migrateLegacyStations — 부르는 곳 있음(design_view_profile_sections) · storage 에 비정규 측점 남음
- common_util_excavation 셋 — 지금은 운영이 부름(design_calc_node)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 21:09:50 +09:00

89 lines
3.6 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/* =============================================================================
* B05_Profile_UI_IrregularStations.ts
* 비정규 측점(구조물 측점) 꼴 · 배수관 판정 · 표시 라벨 — 종단 그래프 · 표 · 3D 가 같이 씀.
*
* chainage_m = 측점번호 × 측점간격(m) + 잔여거리(m).
* ========================================================================== */
import { PIPE_DISPLAY_NAME } from "../common_util/common_util_structure_catalog";
import {
ESCAPE_ROUTE_DEFAULT_WIDTH_M,
PIPE_DEFAULT_DIAMETER_MM,
PIPE_DEFAULT_TYPE,
STRUCTURE_ETC_DEFAULT_NAME,
type StructureType,
} from "@config/config_frontend";
// 그래프 측점 id · 측점 표기 = logic(511-B B-3) — 부르는 쪽은 그대로 여기서 받음
export { irregularLabel, irregularStationId } from "./logic/B05_Profile_Profile_Planted";
export interface IrregularStation {
id: string;
/** 측점번호 X. */
station: number;
/** 잔여거리 XX (m). */
remainder: number;
/** = station × 측점간격 + remainder. 그래프·테이블·3D의 X축 기준. */
chainage_m: number;
/** 표시용 구조물 라벨 — structureLabel()이 만든다 (예: "파형강관 D800", "대피로 2.0m"). */
structure: string;
/** 구조물 종류 드롭다운 값 (2026-08-05 사용자 확정). 구버전 항목은 undefined → "기타" 취급. */
structureType?: StructureType;
/** 배관 하위 옵션 — 관종·직경. */
pipeType?: string;
diameterMm?: number;
/** 사용자가 관종·직경을 손으로 바꿨는가. true면 배수유역 재계산 때 자동 지정으로 덮지 않는다. */
userSized?: boolean;
/** 대피로 하위 옵션 — 폭(m). */
escapeWidthM?: number;
/** 기타 하위 옵션 — 이름 자유 텍스트. */
customName?: string;
/** 어디서 온 항목인가. `pipe`는 배수유역도의 관 매설 지점이 투영된 것이라 손으로
* 지우거나 옮겨도 정본(`pipe_points.json`)을 거쳐야 한다(2026-08-01 사용자 지시). */
origin?: "user" | "pipe";
}
/** 관 매설 지점이 구조물 목록에 실체화될 때 쓰는 종류 값(구 데이터 판정 키라 유지 —
* 화면 표시 이름은 "배수관"이다, 2026-08-17 사용자 지시). */
export const PIPE_STRUCTURE_NAME = "배관";
/** 배수관으로 볼 항목인가. 드롭다운 종류가 "배관"이거나 손으로 이름을 "배관"·"배수관"이라
* 적은 것도 관 지점 정본을 따르게 한다 — 아니면 [초기화]로 지워지지 않고 배수유역도와
* 어긋난다. */
export function isPipeStation(station: {
origin?: "user" | "pipe";
structure: string;
structureType?: StructureType;
}): boolean {
const name = station.structure.trim();
return (
station.origin === "pipe" ||
station.structureType === PIPE_STRUCTURE_NAME ||
name === PIPE_STRUCTURE_NAME ||
name === PIPE_DISPLAY_NAME
);
}
/** 옵션 값들로 표시 라벨을 만든다 — 목록·종단 그래프·3D 마커가 같은 문자열을 쓴다. */
export function structureLabel(entry: {
structureType?: StructureType;
pipeType?: string;
diameterMm?: number;
escapeWidthM?: number;
customName?: string;
structure?: string;
}): string {
switch (entry.structureType) {
case "배관":
return `${entry.pipeType ?? PIPE_DEFAULT_TYPE} D${entry.diameterMm ?? PIPE_DEFAULT_DIAMETER_MM}`;
case "기성막이":
return "기성막이";
case "대피로":
return `대피로 ${(entry.escapeWidthM ?? ESCAPE_ROUTE_DEFAULT_WIDTH_M).toFixed(1)}m`;
case "기타":
return entry.customName?.trim() || STRUCTURE_ETC_DEFAULT_NAME;
default:
return entry.structure ?? "";
}
}