fix(B05): 옵션 · 메모만 고쳐 저장해도 구조물 · 관 측점이 그대로 · 계획고 수정 안 지워짐

PLAN 19장 sub6 ①. 측점 칸(stationFields)이 잔여거리를 소수 1자리로 보이고 저장 때 그 표시값을
다시 읽어, 옵션 · 메모만 고쳐도 측점이 0.1m 단위로 옮겨 저장되던 흠(123.37 → 123.4 · 관 85.05 →
85.0 은 updatePipeFacility 0.005m 기준을 넘어 실제 관 이동). 칸에 실어 둔 누가거리를 기억해
사용자가 칸 글을 안 고쳤으면 그 값을 그대로 돌려줌(읽는 곳 모두 이 한 함수를 거침) · 고치면 친 값.
계획고 수정(station_offsets)은 비정규 측점이 바뀔 때 옛 키를 지우던 것을, 새 목록에 0.005m 안의
측점이 있으면(서버 관 측점 0.01m 반올림) 그 키로 옮김(resetStationEdit · resetStation 의 moveTo).

확인 — ORCA(IP 5181 · 메인 폴더 탭 · 랩탑_보조 프로젝트): 옹벽 기준 6+3.37 저장 → 123.37 ·
메모만 고쳐 저장 → structures.json 123.37 그대로(표시 6+3.4) · 다시 열기 같음. 배수관 1(85.05 ·
표시 4+5.0)에 계획고 ▲ 뒤 관경만 1000 → 800 저장 → pipe_points 85.05 그대로 · station_offsets
유지 · 다시 열기 같음. 시험 뒤 프로젝트 파일은 백업으로 되돌림(diff 0).
시험 test_b05_station_roundtrip(칸 왕복 · 편집 옮김) 통과 · 타입검사 통과.
② 정수 m 격자 붙이기에서 manual 빼기는 횡단 파일 이름 · 도면 ID(cross_{정수m}m)가 B06 · B07 · B08
열쇠라 브레인에게 물음 — 이 커밋에 없음.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VVM3xZ1aUPcUTuW2WZSnwg
This commit is contained in:
2026-09-29 09:52:29 +09:00
co-authored by Claude Opus 5.5
parent c48ed4c309
commit cc3a8a7109
6 changed files with 183 additions and 5 deletions
@@ -178,11 +178,18 @@ export function stationFields(
// 다른 change 리스너(옵션 잠금·임시 배치)보다 먼저 등록돼 정규화된 값이 읽힌다.
[station, remainder].forEach((input) => input.addEventListener("change", normalize));
}
// 칸은 잔여를 소수 1자리로 보임 — 사용자가 칸을 안 고쳤으면 실어 둔 누가거리를 그대로 돌려줌
// (표시값을 다시 읽으면 0.1m 로 뭉개져 옵션 · 메모만 고쳐도 측점이 옮겨 저장됨)
let written: { chainageM: number; station: string; remainder: string } | null = null;
return {
wrap,
station,
remainder,
read(intervalM, required) {
if (written && station.value === written.station && remainder.value === written.remainder) {
markInvalid(false);
return written.chainageM;
}
const stationText = station.value.trim();
const remainderText = remainder.value.trim();
if (!stationText && !remainderText) {
@@ -197,6 +204,7 @@ export function stationFields(
return valid ? stationNo * intervalM + rest : null;
},
write(chainageM, intervalM) {
written = null;
if (chainageM === null) {
station.value = "";
remainder.value = "";
@@ -205,6 +213,7 @@ export function stationFields(
const parts = chainageToStation(chainageM, intervalM);
station.value = String(parts.station);
remainder.value = parts.remainder.toFixed(1);
written = { chainageM, station: station.value, remainder: remainder.value };
},
clearInvalid: () => markInvalid(false),
};