/* ============================================================================= * A00_Common/design/design_stations_server.ts * 계산 자리 stations 「서버」(PLAN 511-B B-2) — 묶음 stations 단계 측점 목록을 서버 Node * `stations.list`(같은 `buildStations`)로. 판이 both 면 null(화면 셈) · 서버 값만 · 잠잠 뒤 · * 끊김 · 실패 = undefined(단계가 화면 셈으로). 구조물 정의는 서버 창구가 붙임. * ========================================================================== */ import { plusStations } from "@util/common_util_structure_station"; import { calcOnServerNow } from "./design_calc_sites"; import { calcOnServerOnly } from "./design_calc_server"; import type { StationsArgs } from "./logic/design_pipeline_stations"; import type { PipelineStation } from "./logic/design_pipeline_types"; export function stationsOnServer( args: StationsArgs, signal: AbortSignal, ): Promise | null { if (!calcOnServerNow("stations")) return null; const [line, curves, pipes, structures, options] = args; const stations = { line, curves, pipes, structures, types: options.types, plus: [...(options.plus ?? plusStations())], interval_m: options.intervalM, include_endpoint: options.includeEndpoint, station_snap: options.stationSnap ?? false, station_snap_step: options.stationSnapStep ?? null, }; return calcOnServerOnly( "stations", "stations.list", { run: ["stations.list"], inputs: { stations }, pick: (results) => results["stations.list"] }, signal, ); }