diff --git a/B06_Section/B06_Section_UI_Page_Persist.ts b/B06_Section/B06_Section_UI_Page_Persist.ts index 267761d1..5c90c6fa 100644 --- a/B06_Section/B06_Section_UI_Page_Persist.ts +++ b/B06_Section/B06_Section_UI_Page_Persist.ts @@ -21,6 +21,7 @@ import { flushPendingPipes } from "../B05_Profile/B05_Profile_Api_Pipes_Draft"; import { flushPendingStructures } from "../B05_Profile/B05_Profile_Api_Structures"; import { flushUphillOverrides } from "../B05_Profile/B05_Profile_Api_Fetch"; import { buildCrossPatches, type CrossPatchSources } from "./B06_Section_UI_Page_Patches"; +import { readState } from "../A00_Common/b_page_state"; import { applyStructureAreaRows, STRUCTURE_AREA_KEYS, @@ -33,25 +34,22 @@ import { balloonOffsetsPayload } from "@util/common_util_mass_haul_balance_view" import { L } from "./B06_Section_UI_Page_Common"; /** - * 암 경계선 오프셋 세션 키 — 저장소와 재계산 창구가 **같은 자리**를 보게 정의처를 하나로 둔다. - * (`B06_Section_Cross_Refresh` 가 패널 없는 B05에서도 같은 값을 읽어 서버로 보낸다.) + * 세션에 쌓인 암 경계선 오프셋(측점키 → m). 없거나 손상되면 빈 객체. + * + * **등록표를 거쳐 읽는다**(2026-09-07 고침). 예전에는 옛 키 `b06:rockb:{p}:{r}` 를 날문자열로 + * 읽었는데, 쓰는 쪽(`B06_Section_UI_Page.ts` 의 `stateKey("rockb", …)`)은 새 키 + * `aislo:draft:rockb:{p}:{r}` 에 쓰고 있어 **읽는 쪽이 늘 빈 값**을 받았다. 그래서 + * 계획선을 고쳐 횡단을 다시 계산할 때(`B06_Section_Cross_Refresh`) 사용자가 옮긴 암 경계선이 + * 안 실려 나가 토사/암 나눔이 기본값으로 돌아갔다 — 수량이 갈리는 자리다. + * 실측(용화 5601e828, route 169): 경계선을 -0.5 → -0.8m 로 옮기니 새 키에만 `{"0.00":-0.8}` + * 가 쌓이고 옛 키는 아예 없었다. */ -export function rockBoundarySessionKey(projectId: string, routeId: number): string { - return `b06:rockb:${projectId}:${routeId}`; -} - -/** 세션에 쌓인 암 경계선 오프셋(측점키 → m). 없거나 손상되면 빈 객체. */ export function readRockBoundarySession( projectId: string, routeId: number, ): Record { - try { - const raw = window.sessionStorage.getItem(rockBoundarySessionKey(projectId, routeId)); - const parsed = raw ? (JSON.parse(raw) as unknown) : null; - return parsed && typeof parsed === "object" ? (parsed as Record) : {}; - } catch { - return {}; - } + const stored = readState>("rockb", projectId, routeId); + return stored && typeof stored === "object" ? stored : {}; } /** 암 경계선 오프셋 저장소 — 값(Map)과 조정창 제어기를 함께 낸다. */