refactor(513-3 덧 RouteEdit 줄 수): 상태줄 머리 · 고른 등고선 글 짓기 = routeHeadText(_Render) · contourHintText(_Contour) 로 옮김 — RouteEdit.ts 699 → 691 줄 · test_430 편집기 배선 · test_399 줄 수 한도 695 통과
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -28,6 +28,7 @@ import {
|
||||
createSheetFollow,
|
||||
fetchRouteSheets,
|
||||
loadRouteEditBackground,
|
||||
contourHintText,
|
||||
type RouteEditContours,
|
||||
type SheetLayers,
|
||||
} from "./B05_Profile_UI_RouteEdit_Contour";
|
||||
@@ -39,7 +40,7 @@ import {
|
||||
} from "./B05_Profile_Api_Replan";
|
||||
import { bindRouteApply } from "./B05_Profile_UI_RouteEdit_Apply";
|
||||
import type { EditedCurve, EditedNode } from "./logic/B05_Profile_UI_RouteEdit_Curve";
|
||||
import { drawRouteEditScene, polylineLengthM, watchTheme } from "./B05_Profile_UI_RouteEdit_Render";
|
||||
import { drawRouteEditScene, routeHeadText, watchTheme } from "./B05_Profile_UI_RouteEdit_Render";
|
||||
import { bindNodeSplice, bindRouteEditNavigation } from "./B05_Profile_UI_RouteEdit_Input";
|
||||
import { bindRouteEditPointer } from "./B05_Profile_UI_RouteEdit_Pointer";
|
||||
import { createCrossPreview } from "./B05_Profile_UI_RouteEdit_Cross";
|
||||
@@ -372,19 +373,10 @@ export async function mountRouteEditor(
|
||||
nodeInfo = built.nodes;
|
||||
}
|
||||
|
||||
/** 상태줄 머리 — 지금 그려진 계획노선 길이와 노드 수(계획서 0-9 ①). 원호가 정점으로
|
||||
* 펴져 있어 브라우저에서 바로 잴 수 있다 — 서버에 묻지 않는다. */
|
||||
/** 상태줄 머리 · 고른 등고선 글 — 짓기는 `_Render` · `_Contour` 몫. */
|
||||
const routeHead = (): string =>
|
||||
`예상노선 ${polylineLengthM(expected).toFixed(1)}m · ` +
|
||||
`계획노선 ${polylineLengthM(plannedLine.length ? plannedLine : planned).toFixed(1)}m · ` +
|
||||
`노드 ${planned.length}개`;
|
||||
|
||||
/** 고른 등고선의 높이 — 못 읽었으면 높이 없이 「고른 등고선」만(계획서 0-9 ⑦). */
|
||||
const contourHint = (): string => {
|
||||
if (pickedContour < 0) return "등고선을 누르면 그 줄의 높이가 보입니다.";
|
||||
const level = contours?.layer.features[pickedContour]?.labelValue ?? null;
|
||||
return level === null ? "등고선 한 줄을 골랐습니다." : `고른 등고선 ${level}m.`;
|
||||
};
|
||||
routeHeadText(expected, plannedLine.length ? plannedLine : planned, planned.length);
|
||||
const contourHint = (): string => contourHintText(contours, pickedContour);
|
||||
|
||||
/** 상태줄 꼬리 — 셈은 `_Edits` 몫. */
|
||||
const curveHint = (): string =>
|
||||
|
||||
@@ -48,6 +48,13 @@ export interface RouteEditContours {
|
||||
minor: (() => PreparedLayer) | null;
|
||||
}
|
||||
|
||||
/** 고른 등고선의 높이 — 못 읽었으면 높이 없이 「고른 등고선」만(계획서 0-9 ⑦). */
|
||||
export function contourHintText(contours: RouteEditContours | null, picked: number): string {
|
||||
if (picked < 0) return "등고선을 누르면 그 줄의 높이가 보입니다.";
|
||||
const level = contours?.layer.features[picked]?.labelValue ?? null;
|
||||
return level === null ? "등고선 한 줄을 골랐습니다." : `고른 등고선 ${level}m.`;
|
||||
}
|
||||
|
||||
interface ContourResponse {
|
||||
contours: Array<{ level: number; coordinates: Array<[number, number, number]> }>;
|
||||
}
|
||||
|
||||
@@ -66,6 +66,16 @@ export function polylineLengthM(points: ReadonlyArray<Vertex>): number {
|
||||
return total;
|
||||
}
|
||||
|
||||
/** 상태줄 머리 — 지금 그려진 계획노선 길이와 노드 수(계획서 0-9 ①). 원호가 정점으로
|
||||
* 펴져 있어 브라우저에서 바로 잴 수 있다 — 서버에 묻지 않는다. */
|
||||
export const routeHeadText = (
|
||||
expected: ReadonlyArray<Vertex>,
|
||||
line: ReadonlyArray<Vertex>,
|
||||
nodeCount: number,
|
||||
): string =>
|
||||
`예상노선 ${polylineLengthM(expected).toFixed(1)}m · ` +
|
||||
`계획노선 ${polylineLengthM(line).toFixed(1)}m · 노드 ${nodeCount}개`;
|
||||
|
||||
export interface RouteEditScene {
|
||||
view: ViewState;
|
||||
/** 사업지 좌표(m) → 캔버스 px. */
|
||||
|
||||
Reference in New Issue
Block a user