지움
- 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>
36 lines
1.9 KiB
TypeScript
36 lines
1.9 KiB
TypeScript
/* =============================================================================
|
||
* B05_Profile_Util_Station.ts
|
||
* 측점 표기 공용 유틸 — 측점번호+잔여거리 ↔ 누가거리(chainage) 변환·서식.
|
||
*
|
||
* 구조물 위치는 저장은 누가거리(m)로 하되 **화면 입출력은 측점번호+잔여거리**로 한다
|
||
* (2026-08-17 사용자 확정). 근거: 중심선측량 측점 20m + 구조물 지점 보조말뚝
|
||
* (지식DB 설계제원_총괄 §8). 표기 예: "3+18" = 측점 3번에서 18m — 화면 표기는
|
||
* `common_util_station.stationLabel` 한 벌(거리는 정수로 보이기만 · 값은 소수).
|
||
*
|
||
* 변환식은 비정규 측점 UI(`B05_Profile_UI_IrregularStations.ts`)와 같다 —
|
||
* chainage_m = 측점번호 × 측점간격(m) + 잔여거리(m). 측점간격은 호출 시점에 받는다
|
||
* (프로젝트 설정에 따라 바뀌므로 상수로 굳히지 않는다).
|
||
* ========================================================================== */
|
||
|
||
/** 측점번호 X + 잔여거리 XX(m) → 누가거리(m). */
|
||
export function stationToChainage(station: number, remainder: number, intervalM: number): number {
|
||
return station * intervalM + remainder;
|
||
}
|
||
|
||
/** 누가거리(m) → 측점번호 + 잔여거리. 잔여거리는 [0, 간격) 범위로 정규화한다. */
|
||
export function chainageToStation(
|
||
chainageM: number,
|
||
intervalM: number,
|
||
): { station: number; remainder: number } {
|
||
if (!(intervalM > 0)) return { station: 0, remainder: Math.max(0, chainageM) };
|
||
const clamped = Math.max(0, chainageM);
|
||
let station = Math.floor(clamped / intervalM);
|
||
let remainder = clamped - station * intervalM;
|
||
// 부동소수 잔여가 간격과 사실상 같으면 다음 측점의 0으로 올린다 (19.999… → 1+0.0).
|
||
if (intervalM - remainder < 0.005) {
|
||
station += 1;
|
||
remainder = 0;
|
||
}
|
||
return { station, remainder };
|
||
}
|