260723_9_종단설계 1차 완료
This commit is contained in:
@@ -359,14 +359,6 @@ export async function renderB05Route(root: HTMLElement): Promise<void> {
|
|||||||
panel.setStale(false);
|
panel.setStale(false);
|
||||||
if (next.route) {
|
if (next.route) {
|
||||||
const stored = next.route.algorithm_params ?? {};
|
const stored = next.route.algorithm_params ?? {};
|
||||||
const metrics = (stored.metrics as Record<string, unknown> | undefined) ?? {
|
|
||||||
length_m: next.route.total_length_m,
|
|
||||||
min_slope: next.route.min_slope,
|
|
||||||
max_slope: next.route.max_slope,
|
|
||||||
mean_slope: next.route.mean_slope,
|
|
||||||
cost_score: next.route.cost_score,
|
|
||||||
};
|
|
||||||
panel.renderMetrics(metrics);
|
|
||||||
viewer.markers.renderRoute(
|
viewer.markers.renderRoute(
|
||||||
next.route_points,
|
next.route_points,
|
||||||
(stored.curve_warning_segments as Array<{
|
(stored.curve_warning_segments as Array<{
|
||||||
|
|||||||
@@ -172,6 +172,7 @@ export function createRoutePanel(callbacks: PanelCallbacks) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const contour = section("등고선 간격");
|
const contour = section("등고선 간격");
|
||||||
|
contour.root.classList.add("is-collapsed");
|
||||||
const contourInterval = numberField("간격 (m), 최소 0.5m", "1");
|
const contourInterval = numberField("간격 (m), 최소 0.5m", "1");
|
||||||
const contourRow = document.createElement("div");
|
const contourRow = document.createElement("div");
|
||||||
contourRow.className = "b05-route__contour-row";
|
contourRow.className = "b05-route__contour-row";
|
||||||
@@ -182,6 +183,7 @@ export function createRoutePanel(callbacks: PanelCallbacks) {
|
|||||||
contour.body.append(contourRow);
|
contour.body.append(contourRow);
|
||||||
|
|
||||||
const palette = section("포인트 팔레트");
|
const palette = section("포인트 팔레트");
|
||||||
|
palette.root.classList.add("is-collapsed");
|
||||||
const paletteGrid = document.createElement("div");
|
const paletteGrid = document.createElement("div");
|
||||||
paletteGrid.className = "b05-route__palette";
|
paletteGrid.className = "b05-route__palette";
|
||||||
const pointLabels: Record<RoutePointKind, string> = {
|
const pointLabels: Record<RoutePointKind, string> = {
|
||||||
@@ -215,6 +217,7 @@ export function createRoutePanel(callbacks: PanelCallbacks) {
|
|||||||
selected.body.append(selectedName, radius.wrapper, selectedActions);
|
selected.body.append(selectedName, radius.wrapper, selectedActions);
|
||||||
|
|
||||||
const conditions = section("임도 기준·옵션");
|
const conditions = section("임도 기준·옵션");
|
||||||
|
conditions.root.classList.add("is-collapsed");
|
||||||
const algorithm = document.createElement("select");
|
const algorithm = document.createElement("select");
|
||||||
algorithm.innerHTML =
|
algorithm.innerHTML =
|
||||||
'<option value="dijkstra">Dijkstra</option><option value="ridge_valley">능선·계곡</option>';
|
'<option value="dijkstra">Dijkstra</option><option value="ridge_valley">능선·계곡</option>';
|
||||||
@@ -248,6 +251,7 @@ export function createRoutePanel(callbacks: PanelCallbacks) {
|
|||||||
conditions.body.append(algorithmLabel, gradeLabel, paved.wrapper, avoidPass.wrapper, details);
|
conditions.body.append(algorithmLabel, gradeLabel, paved.wrapper, avoidPass.wrapper, details);
|
||||||
|
|
||||||
const sectionOptions = section(L("B05_Route_Group_SectionOptions"));
|
const sectionOptions = section(L("B05_Route_Group_SectionOptions"));
|
||||||
|
sectionOptions.root.classList.add("is-collapsed");
|
||||||
const stationInterval = numberField(L("B05_Route_Field_StationInterval"));
|
const stationInterval = numberField(L("B05_Route_Field_StationInterval"));
|
||||||
const crossSampleInterval = numberField(L("B05_Route_Field_CrossSample"));
|
const crossSampleInterval = numberField(L("B05_Route_Field_CrossSample"));
|
||||||
const longSampleInterval = numberField(L("B05_Route_Field_LongSample"));
|
const longSampleInterval = numberField(L("B05_Route_Field_LongSample"));
|
||||||
@@ -331,16 +335,6 @@ export function createRoutePanel(callbacks: PanelCallbacks) {
|
|||||||
terrainType.addEventListener("change", syncCriteria);
|
terrainType.addEventListener("change", syncCriteria);
|
||||||
syncCriteria();
|
syncCriteria();
|
||||||
|
|
||||||
const result = section("경로 설계 산출 결과");
|
|
||||||
const stale = document.createElement("span");
|
|
||||||
stale.className = "b05-route__stale";
|
|
||||||
stale.textContent = "재탐색 필요";
|
|
||||||
stale.hidden = true;
|
|
||||||
const metrics = document.createElement("div");
|
|
||||||
metrics.className = "b05-route__metrics";
|
|
||||||
metrics.textContent = "경로를 계산하면 결과가 표시됩니다.";
|
|
||||||
result.body.append(stale, metrics);
|
|
||||||
|
|
||||||
const solveButton = button("최적 경로 계산", callbacks.onSolve, "filled");
|
const solveButton = button("최적 경로 계산", callbacks.onSolve, "filled");
|
||||||
const confirmButton = button("경로 확정", callbacks.onConfirm);
|
const confirmButton = button("경로 확정", callbacks.onConfirm);
|
||||||
confirmButton.disabled = true;
|
confirmButton.disabled = true;
|
||||||
@@ -370,15 +364,14 @@ export function createRoutePanel(callbacks: PanelCallbacks) {
|
|||||||
];
|
];
|
||||||
inputElements.forEach((input) => input.addEventListener("change", callbacks.onInputChange));
|
inputElements.forEach((input) => input.addEventListener("change", callbacks.onInputChange));
|
||||||
root.append(
|
root.append(
|
||||||
|
gradeLine.root,
|
||||||
contour.root,
|
contour.root,
|
||||||
|
sectionOptions.root,
|
||||||
|
startBasis.root,
|
||||||
|
irregular.root,
|
||||||
palette.root,
|
palette.root,
|
||||||
selected.root,
|
selected.root,
|
||||||
conditions.root,
|
conditions.root,
|
||||||
sectionOptions.root,
|
|
||||||
gradeLine.root,
|
|
||||||
startBasis.root,
|
|
||||||
irregular.root,
|
|
||||||
result.root,
|
|
||||||
actionRow,
|
actionRow,
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -451,29 +444,11 @@ export function createRoutePanel(callbacks: PanelCallbacks) {
|
|||||||
radius.value = String(point.radius_m ?? 25);
|
radius.value = String(point.radius_m ?? 25);
|
||||||
},
|
},
|
||||||
setStale(value: boolean) {
|
setStale(value: boolean) {
|
||||||
stale.hidden = !value;
|
|
||||||
confirmButton.disabled = value;
|
confirmButton.disabled = value;
|
||||||
},
|
},
|
||||||
setCanConfirm(value: boolean) {
|
setCanConfirm(value: boolean) {
|
||||||
confirmButton.disabled = !value;
|
confirmButton.disabled = !value;
|
||||||
},
|
},
|
||||||
renderMetrics(values: Record<string, unknown>) {
|
|
||||||
const rows = [
|
|
||||||
["총 연장", values.length_m],
|
|
||||||
["평균 경사", values.avg_grade_pct ?? values.mean_slope],
|
|
||||||
["최대 경사", values.max_grade_pct ?? values.max_slope],
|
|
||||||
["비용", values.cost_score],
|
|
||||||
["경사 초과", values.slope_violations],
|
|
||||||
["곡선반경 미달", values.curve_violations],
|
|
||||||
];
|
|
||||||
metrics.replaceChildren(
|
|
||||||
...rows.map(([label, value]) => {
|
|
||||||
const row = document.createElement("div");
|
|
||||||
row.textContent = `${label}: ${value ?? "-"}`;
|
|
||||||
return row;
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user