36 lines
1.4 KiB
TypeScript
36 lines
1.4 KiB
TypeScript
/* =============================================================================
|
|
* A00_Common/design/design_route_server.ts
|
|
* 계산 자리 route 「서버」(PLAN 511-B B-5) — 묶음 route 단계 노선(선 · 곡선)을 서버 Node
|
|
* `route.polyline`(같은 `buildEditedPolyline` · 노선 저장과 같은 셈)으로. 판이 both 면 null(화면 셈) ·
|
|
* 서버 값만 · 잠잠 뒤 · 끊김 · 실패 = undefined(단계가 화면 셈으로).
|
|
* ========================================================================== */
|
|
|
|
import type { DraftArgs } from "../../B05_Profile/logic/B05_Profile_Pipeline_RouteGround";
|
|
import type { EditedPolyline } from "../../B05_Profile/logic/B05_Profile_UI_RouteEdit_Curve";
|
|
import { calcOnServerNow } from "./design_calc_sites";
|
|
import { calcOnServerOnly } from "./design_calc_server";
|
|
|
|
export function routeOnServer(
|
|
args: DraftArgs,
|
|
signal: AbortSignal,
|
|
): Promise<EditedPolyline | undefined> | null {
|
|
if (!calcOnServerNow("route")) return null;
|
|
const [points, curveOn, curveRadius, minRadiusM] = args;
|
|
const route_polyline = {
|
|
points,
|
|
curve_flags: curveOn,
|
|
radii: curveRadius,
|
|
min_radius_m: minRadiusM,
|
|
};
|
|
return calcOnServerOnly<EditedPolyline>(
|
|
"route",
|
|
"route.polyline",
|
|
{
|
|
run: ["route.polyline"],
|
|
inputs: { route_polyline },
|
|
pick: (results) => results["route.polyline"],
|
|
},
|
|
signal,
|
|
);
|
|
}
|