feat(viewer): unify spatial clipping, planning and observation surfaces
Share spatial clipping and height slices across live planning and recorded observations. Refine scene navigation, report serialization and viewer presentation.
This commit is contained in:
@@ -171,7 +171,7 @@ export function CanonicalRecordedLabReplay<
|
||||
>
|
||||
{splitView || paneToolbarsAlwaysVisible ? (
|
||||
<div
|
||||
className="m4-replay-threat-visual__pane-toolbar"
|
||||
className="m4-replay-threat-visual__pane-toolbar nodedc-viewport-controls"
|
||||
data-pane-toolbar="media"
|
||||
data-multi-semantic={mediaMultiLayer ? "true" : undefined}
|
||||
>
|
||||
@@ -190,7 +190,7 @@ export function CanonicalRecordedLabReplay<
|
||||
>
|
||||
{splitView || paneToolbarsAlwaysVisible ? (
|
||||
<div
|
||||
className="m4-replay-threat-visual__pane-toolbar"
|
||||
className="m4-replay-threat-visual__pane-toolbar nodedc-viewport-controls"
|
||||
data-pane-toolbar="spatial"
|
||||
>
|
||||
{spatialLeadingControl}
|
||||
|
||||
@@ -83,7 +83,7 @@ export function LaboratoryEvidenceViewer<
|
||||
}, [expanded, onExpandedChange]);
|
||||
|
||||
const controls = (
|
||||
<div className="laboratory-evidence-viewer__controls">
|
||||
<div className="laboratory-evidence-viewer__controls nodedc-viewport-controls">
|
||||
{actions}
|
||||
{modeControlsVisible && secondaryMode ? (
|
||||
<SegmentedControl
|
||||
@@ -137,7 +137,7 @@ export function LaboratoryEvidenceViewer<
|
||||
{children}
|
||||
</div>
|
||||
{transport ? (
|
||||
<div className="laboratory-evidence-viewer__transport">
|
||||
<div className="laboratory-evidence-viewer__transport nodedc-viewport-controls">
|
||||
{transport}
|
||||
</div>
|
||||
) : null}
|
||||
@@ -149,7 +149,7 @@ export function LaboratoryEvidenceViewer<
|
||||
</div>
|
||||
{overlay}
|
||||
{transport ? (
|
||||
<div className="laboratory-evidence-viewer__transport">
|
||||
<div className="laboratory-evidence-viewer__transport nodedc-viewport-controls">
|
||||
{transport}
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
@@ -101,7 +101,7 @@ export function LaboratoryReviewWorkspaceFrame({
|
||||
keepFocusInside(event, event.currentTarget);
|
||||
}}
|
||||
>
|
||||
<header className="laboratory-review-workspace__toolbar">{toolbar}</header>
|
||||
<header className="laboratory-review-workspace__toolbar nodedc-viewport-controls">{toolbar}</header>
|
||||
<div className="laboratory-review-workspace__stage">{stage}</div>
|
||||
{inspector ? <footer className="laboratory-review-workspace__inspector">{inspector}</footer> : null}
|
||||
{overlays}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import {heightSlice} from "../../core/heightSlice";
|
||||
import {useEffect,useRef,useState} from 'react';
|
||||
import {Button,LoadingRegion,RangeControl} from '@nodedc/ui-react';
|
||||
import {createIsolatedRerunHost} from '../rerun/isolatedRerunHost';
|
||||
@@ -26,16 +27,20 @@ export function PlanningLiveScene({runId,options={},active=false,revision=0,heig
|
||||
const optionsRef=useRef(options);optionsRef.current=options;
|
||||
const stateRef=useRef({active,revision});stateRef.current={active,revision};
|
||||
const ceilingRef=useRef<number|null>(null);
|
||||
const floorRef=useRef<number|null>(null);
|
||||
const boundsRef=useRef<{min:number;max:number}|null>(null);
|
||||
const host=useRef<HTMLDivElement>(null);
|
||||
const [state,setState]=useState('loading'),[retry,setRetry]=useState(0);
|
||||
const [bounds,setBounds]=useState<{min:number;max:number}|null>(null);
|
||||
const [ceiling,setCeiling]=useState<number|null>(null);
|
||||
const [floor,setFloor]=useState<number|null>(null);
|
||||
useEffect(()=>{
|
||||
ceilingRef.current=null;floorRef.current=null;setCeiling(null);setFloor(null);
|
||||
},[runId]);
|
||||
useEffect(()=>{
|
||||
ceilingRef.current=null;
|
||||
const next=heightBounds&&Number.isFinite(heightBounds.min)&&Number.isFinite(heightBounds.max)&&heightBounds.max>heightBounds.min?heightBounds:null;
|
||||
boundsRef.current=next;
|
||||
setBounds(next);setCeiling(null);
|
||||
setBounds(next);
|
||||
},[runId,heightBounds?.min,heightBounds?.max]);
|
||||
useEffect(()=>{
|
||||
if(!host.current)return;
|
||||
@@ -54,6 +59,7 @@ export function PlanningLiveScene({runId,options={},active=false,revision=0,heig
|
||||
stopStream=startPlanningSceneStream({
|
||||
url:`${plannerBase}/live-tests/${runId}/scene-delta.rrd`,
|
||||
snapshot:()=>({...stateRef.current,options:{...optionsRef.current,
|
||||
...(floorRef.current===null?{}:{floor_m:floorRef.current}),
|
||||
...(ceilingRef.current===null?{}:{ceiling_m:ceilingRef.current})}}),
|
||||
apply:async(bytes,delivery)=>{
|
||||
if(disposed)return;
|
||||
@@ -62,9 +68,6 @@ export function PlanningLiveScene({runId,options={},active=false,revision=0,heig
|
||||
const previous=boundsRef.current;
|
||||
if(!previous||previous.min!==next.min||previous.max!==next.max){
|
||||
boundsRef.current=next;setBounds(next);
|
||||
if(ceilingRef.current!==null&&(ceilingRef.current<next.min||ceilingRef.current>next.max)){
|
||||
ceilingRef.current=null;setCeiling(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
sceneAvailable=true;
|
||||
@@ -89,15 +92,15 @@ export function PlanningLiveScene({runId,options={},active=false,revision=0,heig
|
||||
return()=>{disposed=true;stopStream?.();reporter.dispose();clearTimeout(timeout);runtime.dispose();};
|
||||
},[runId,retry]);
|
||||
const sourceBounds=bounds??heightBounds;
|
||||
const rangeBounds=sourceBounds?{min:Math.min(sourceBounds.min,0),max:CLIP_CEILING_M}:null;
|
||||
const rangeBounds=sourceBounds?{min:Math.min(sourceBounds.min,0,floor??Infinity),max:Math.max(CLIP_CEILING_M,sourceBounds.max,ceiling??-Infinity)}:null;
|
||||
return <LoadingRegion loading={state==='loading'} label="Загрузка эталона и нового прохода" className="planning-live__scene">
|
||||
<div ref={host} className="session-overview__runtime rerun-single-view-content" style={{visibility:state==='ready'?'visible':'hidden'}} />
|
||||
{rangeBounds&&state==='ready'&&<div className="session-overview__height">
|
||||
<RangeControl orientation="vertical" limitSide="left" label="Срез" value={ceiling??rangeBounds.max} min={rangeBounds.min} max={rangeBounds.max} step="any"
|
||||
<RangeControl orientation="vertical" limitSide="left" label="Срез" value={[floor??rangeBounds.min,ceiling??rangeBounds.max]} min={rangeBounds.min} max={rangeBounds.max} step="any"
|
||||
formatValue={value=>`${value.toFixed(1).replace('.',',')} м`} formatLimit={value=>value.toFixed(1).replace('.',',')}
|
||||
onChange={value=>{
|
||||
const next=value>=rangeBounds.max-Math.max(1,rangeBounds.max-rangeBounds.min)*1e-9?null:value;
|
||||
ceilingRef.current=next;setCeiling(next);
|
||||
const next=heightSlice(value,[rangeBounds.min,rangeBounds.max]);
|
||||
floorRef.current=next.floor;setFloor(next.floor);ceilingRef.current=next.ceiling;setCeiling(next.ceiling);
|
||||
}}/>
|
||||
</div>}
|
||||
{state==='error'&&<div className="session-overview__empty"><span>Обновление сцены недоступно.</span><Button onClick={()=>setRetry(v=>v+1)}>Повторить подключение сцены</Button></div>}
|
||||
|
||||
@@ -7,11 +7,11 @@ export function ObservationMount({element,className='observation-mount'}:{elemen
|
||||
useLayoutEffect(()=>{const host=ref.current!;host.append(element);return()=>{if(element.parentElement===host)element.remove();};},[element]);
|
||||
return <div ref={ref} className={className}/>;
|
||||
}
|
||||
export function ObservationDeck({ids,mounts,layout,onTreeChange,labels,focusedId,children}:{
|
||||
export function ObservationDeck({ids,mounts,layout,onTreeChange,labels,focusedId,minimumSizes,children}:{
|
||||
ids:string[];mounts:Map<string,HTMLElement>;layout:ObservationLayout;onTreeChange:(tree:DockTree)=>void;
|
||||
labels:Record<string,string>;focusedId?:string|null;children:ReactNode;
|
||||
minimumSizes?:Record<string,{width:number;height:number}>; labels:Record<string,string>;focusedId?:string|null;children:ReactNode;
|
||||
}){
|
||||
return <DockLayout tree={observationTree(layout,ids)} onTreeChange={onTreeChange}
|
||||
focusedId={focusedId} panels={ids.map(id=>({id,label:labels[id]??id}))}
|
||||
focusedId={focusedId} panels={ids.map(id=>({id,label:labels[id]??id,minimumSize:minimumSizes?.[id],preferredSize:!layout.tree&&!Object.keys(layout.splits).length?minimumSizes?.[id]:undefined}))}
|
||||
renderPanel={id=><ObservationMount element={mounts.get(id)!}/>}>{children}</DockLayout>;
|
||||
}
|
||||
|
||||
@@ -9,5 +9,5 @@ export function ObservationPanelHeader({children}:{children:ReactNode}) {
|
||||
measure();const observer=new ResizeObserver(measure);observer.observe(header);
|
||||
return()=>observer.disconnect();
|
||||
},[]);
|
||||
return <header ref={ref} className="observation-panel__header">{children}</header>;
|
||||
return <header ref={ref} className="observation-panel__header nodedc-viewport-controls">{children}</header>;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { heightSlice } from "../../core/heightSlice";
|
||||
import { type ReactNode, useEffect, useRef, useState } from "react";
|
||||
import { Button, LoadingRegion, RangeControl, SegmentedControl } from "@nodedc/ui-react";
|
||||
import { createIsolatedRerunHost } from "../rerun/isolatedRerunHost";
|
||||
@@ -11,6 +12,7 @@ export function SessionOverviewScene({ sourceUrl, toolbar, hideTitle=false, comp
|
||||
const [retry, setRetry] = useState(0);
|
||||
const [metadata, setMetadata] = useState<OverviewSpatialMetadata | null>(null);
|
||||
const [ceiling, setCeiling] = useState<number | null>(null);
|
||||
const [floor, setFloor] = useState<number | null>(null);
|
||||
const [mode, setMode] = useState<OverviewViewMode>("3d");
|
||||
const [viewError, setViewError] = useState<string | null>(null);
|
||||
const [visiblePoints, setVisiblePoints] = useState<number | null>(null);
|
||||
@@ -26,7 +28,7 @@ export function SessionOverviewScene({ sourceUrl, toolbar, hideTitle=false, comp
|
||||
const abort = new AbortController();
|
||||
appliedMode.current = null;
|
||||
setState("loading");
|
||||
setMetadata(null); setCeiling(null); setMode("3d"); setVisiblePoints(null); setViewError(null);
|
||||
setMetadata(null); setCeiling(null); setFloor(null); setMode("3d"); setVisiblePoints(null); setViewError(null);
|
||||
setRepresentation("original"); setAppliedRepresentation("original"); setUpdating(false);
|
||||
void fetchOverviewSpatial(sourceUrl, abort.signal).then(data => {
|
||||
if (disposed) return;
|
||||
@@ -56,7 +58,7 @@ export function SessionOverviewScene({ sourceUrl, toolbar, hideTitle=false, comp
|
||||
const timer = setTimeout(() => {
|
||||
const aspect = Math.max(.1, Math.min(20, (host.current?.clientWidth ?? 1) / Math.max(1, (host.current?.clientHeight ?? 1) - 28)));
|
||||
void updateOverviewSpatial(sourceUrl, ceiling, appliedMode.current === mode ? null : mode, aspect, abort.signal,
|
||||
comparison?.generation ?? null, comparison ? representation : "original").then(result => {
|
||||
comparison?.generation ?? null, comparison ? representation : "original", floor).then(result => {
|
||||
if (abort.signal.aborted || !controller.current) return;
|
||||
controller.current.channel.send_rrd(result.bytes);
|
||||
appliedMode.current = mode;
|
||||
@@ -65,12 +67,12 @@ export function SessionOverviewScene({ sourceUrl, toolbar, hideTitle=false, comp
|
||||
}).catch(() => { if (!abort.signal.aborted) { setUpdating(false); setViewError("Не удалось обновить вид облака. Показан предыдущий вид."); } });
|
||||
}, 180);
|
||||
return () => { abort.abort(); clearTimeout(timer); };
|
||||
}, [state, metadata, sourceUrl, ceiling, mode, retry, comparison, representation]);
|
||||
}, [state, metadata, sourceUrl, ceiling, floor, mode, retry, comparison, representation]);
|
||||
|
||||
const low = comparison?.height_min_m ?? metadata?.height_min_m;
|
||||
const high = comparison?.height_max_m ?? metadata?.height_max_m;
|
||||
return <>
|
||||
<div className={`session-overview__scene-head ${hideTitle?"session-overview__scene-head--end":""}`}>{!hideTitle&&<h2>Облако и траектория</h2>}
|
||||
<div className={`session-overview__scene-head nodedc-viewport-controls ${hideTitle?"session-overview__scene-head--end":""}`}>{!hideTitle&&<h2>Облако и траектория</h2>}
|
||||
{compareVersions && comparison && <SegmentedControl label="Версия облака" value={representation} onChange={setRepresentation}
|
||||
items={[{ value: "original", label: "Исходное", disabled: state !== "ready" }, { value: "corrected", label: "Исправленное", disabled: state !== "ready" }]} />}
|
||||
<SegmentedControl label="Вид облака" value={mode} onChange={setMode}
|
||||
@@ -80,15 +82,15 @@ export function SessionOverviewScene({ sourceUrl, toolbar, hideTitle=false, comp
|
||||
<LoadingRegion loading={state === "loading" || (state === "ready" && !!metadata && visiblePoints === null && !viewError)} label="Загрузка облака" className="session-overview__scene">
|
||||
<div ref={host} className={`session-overview__runtime ${hideTitle?"rerun-single-view-content":""}`} style={{ visibility: state === "ready" && metadata && visiblePoints !== null ? "visible" : "hidden" }} />
|
||||
{low != null && high != null && high > low && state === "ready" && <div className="session-overview__height">
|
||||
<RangeControl orientation="vertical" limitSide="left" label="Срез" value={ceiling ?? high} min={low} max={high} step="any"
|
||||
<RangeControl orientation="vertical" limitSide="left" label="Срез" value={[floor ?? low, ceiling ?? high]} min={low} max={high} step="any"
|
||||
formatValue={value => `${value.toFixed(1).replace('.', ',')} м`} formatLimit={value => value.toFixed(1).replace('.', ',')}
|
||||
onChange={value => setCeiling(value >= high - Math.max(1, high - low) * 1e-9 ? null : value)} />
|
||||
onChange={value => { const next = heightSlice(value, [low, high]); setFloor(next.floor); setCeiling(next.ceiling); }} />
|
||||
</div>}
|
||||
{state === "error" && <div className="session-overview__empty"><span>Не удалось открыть облако.</span><Button onClick={() => setRetry(n => n + 1)}>Повторить</Button></div>}
|
||||
</LoadingRegion>
|
||||
<span className="session-overview__note" role="status" aria-busy={updating}>
|
||||
{updating ? "Обновление · " : comparison ? `${appliedRepresentation === "corrected" ? "Исправленное" : "Исходное"} · ` : ""}
|
||||
{ceiling == null ? "Без среза" : `Высота ≤ ${ceiling.toFixed(1)} м`} · {visiblePoints?.toLocaleString("ru-RU") ?? "—"} точек
|
||||
{floor == null && ceiling == null ? "Без среза" : `${floor == null ? "" : `${floor.toFixed(1)} м ≤ `}Высота${ceiling == null ? "" : ` ≤ ${ceiling.toFixed(1)} м`}`} · {visiblePoints?.toLocaleString("ru-RU") ?? "—"} точек
|
||||
{comparison && <><br />Выборка для просмотра. Исходная запись сохранена отдельно.</>}
|
||||
</span>
|
||||
{viewError && <div className="session-overview__note" role="alert">{viewError}<Button onClick={() => setRetry(n => n + 1)}>Повторить</Button></div>}
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
.observation-panel__title { display:flex; align-items:center; gap:var(--nodedc-space-2); flex:1; min-width:0; }
|
||||
.observation-header-slot, .observation-header-slot > div { display:flex; align-items:center; gap:var(--nodedc-space-2); flex-shrink:0; }
|
||||
.observation-header-slot:has(> div:empty) { display:none; }
|
||||
.observation-panel__title .observation-header-slot, .observation-panel__title .observation-header-slot > div { min-width:0; max-width:100%; flex-shrink:1; }
|
||||
.observation-layer-select { min-width:0; max-width:120px; }
|
||||
.observation-layer-select button { max-width:100%; }
|
||||
.observation-layer-select button > span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
|
||||
@@ -29,6 +30,7 @@
|
||||
.observation-source__media video, .observation-source__media canvas { width:100%; height:100%; object-fit:contain; }
|
||||
.observation-source__media[data-live="false"] > *, .observation-source__media [data-live="false"] { visibility:hidden; }
|
||||
.observation-source__notice { position:absolute; inset:max(30%, calc(var(--observation-overlay-header-space, 0px) + var(--nodedc-space-3))) var(--nodedc-space-4) auto; text-align:center; color:var(--nodedc-text-secondary); font-size:calc(var(--nodedc-font-size-lg) * .7); }
|
||||
.observation-source__notice--centered { inset:var(--observation-overlay-header-space, 0px) 0 0; margin:0; padding:var(--nodedc-space-4); display:grid; place-content:center; font-size:var(--nodedc-font-size-sm); pointer-events:none; }
|
||||
.observation-rerun, .observation-rerun > div, .observation-map > div { width:100%; height:100%; }
|
||||
.observation-settings { display:flex; flex-direction:column; gap:var(--nodedc-space-4); }
|
||||
.observation-layer { display:grid; grid-template-columns:minmax(0, 1fr) 50%; align-items:center; gap:var(--nodedc-space-3); }
|
||||
@@ -45,10 +47,11 @@
|
||||
.observation-panel-drag.is-dragging { z-index:var(--nodedc-layer-panel); }
|
||||
.observation-split:has(.observation-panel-drag.is-dragging),
|
||||
.observation-split > .nodedc-split-pane__panel:has(.observation-panel-drag.is-dragging) { position:relative; overflow:visible; z-index:var(--nodedc-layer-panel); }
|
||||
@container (max-width:340px) {
|
||||
@container (max-width:420px) {
|
||||
.observation-panel__header { flex-wrap:wrap; }
|
||||
.observation-panel__title { min-width:80px; }
|
||||
.observation-panel__header > .observation-actions { max-width:100%; flex-wrap:wrap; justify-content:flex-end; margin-left:auto; }
|
||||
.observation-panel__title:has(.rover-view__title) { min-width:min(160px, 100%); }
|
||||
.observation-panel__header > .observation-actions { max-width:100%; flex-wrap:wrap; justify-content:flex-end; margin-left:auto; gap:var(--nodedc-space-1); }
|
||||
}
|
||||
|
||||
.observation-panel__surface--overlay .rover-telemetry { padding-top:calc(var(--observation-overlay-header-space) + var(--nodedc-space-3)); }
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
/** View-only bounds. Each full-range endpoint disables its own clipping plane. */
|
||||
export function heightSlice([lower, upper]: readonly [number, number], [min, max]: readonly [number, number]) {
|
||||
const tolerance = Math.max(1, max - min) * 1e-9;
|
||||
return { floor: lower <= min + tolerance ? null : lower,
|
||||
ceiling: upper >= max - tolerance ? null : upper };
|
||||
}
|
||||
@@ -2,7 +2,7 @@ import { createContext, useCallback, useContext, useEffect, useRef, useState, ty
|
||||
import { plannerBase, plannerRequest, type Draft } from './planner';
|
||||
|
||||
export interface PlanningLiveTest {
|
||||
schema_version: 'missioncore.planning-live-test/v1'; id: string; profile: 'planning'; plugin_id:string; draft: Draft;
|
||||
schema_version: 'missioncore.planning-live-test/v1'|'missioncore.planning-live-status/v1'; id: string; profile: 'planning'; plugin_id:string; draft: Omit<Draft,'route'> & {route:Omit<Draft['route'],'points'>};
|
||||
state: 'preparing'|'waiting'|'running'|'completed'|'cancelled'|'error'|'interrupted';
|
||||
planning_phase?: 'preparing'|'waiting-cloud'|'collecting'|'searching'|'refreshing'|'validating'|'tracking'|'lost'|'ended';
|
||||
tracking_state?: 'acquiring'|'tracking'|'lost';
|
||||
@@ -40,7 +40,7 @@ export function PlanningTestProvider({children}:{children:ReactNode}) {
|
||||
let disposed=false, timer:ReturnType<typeof setTimeout>;
|
||||
const poll=async()=>{
|
||||
const expected=generation.current;
|
||||
try { const next=await plannerRequest<PlanningLiveTest|null>(endpoint+'/active'); if(!disposed && expected===generation.current) {setTest(next);setPollError(null);} }
|
||||
try { const next=await plannerRequest<PlanningLiveTest|null>(endpoint+'/status'); if(!disposed && expected===generation.current) {setTest(next);setPollError(null);} }
|
||||
catch(e) {if(!disposed && expected===generation.current)setPollError(e instanceof Error?e.message:'Исследование недоступно.');}
|
||||
if(!disposed)timer=setTimeout(()=>void poll(),1500);
|
||||
};void poll();return()=>{disposed=true;clearTimeout(timer);};
|
||||
|
||||
@@ -22,13 +22,13 @@ export async function fetchOverviewSpatial(source: string, signal: AbortSignal):
|
||||
return response.json();
|
||||
}
|
||||
export async function updateOverviewSpatial(source: string, ceiling: number | null, mode: OverviewViewMode | null, aspect: number, signal: AbortSignal,
|
||||
comparisonGeneration: string | null = null, representation: OverviewRepresentation = "original") {
|
||||
comparisonGeneration: string | null = null, representation: OverviewRepresentation = "original", floor: number | null = null) {
|
||||
if (representation === "corrected" && !comparisonGeneration) throw new Error("Исправленная версия недоступна.");
|
||||
const url = endpoint(source);
|
||||
const generation = url.searchParams.get("generation");
|
||||
url.search = "";
|
||||
const response = await fetch(url, { method: "POST", signal, headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ generation, ceiling_m: ceiling, mode, aspect,
|
||||
body: JSON.stringify({ generation, ceiling_m: ceiling, floor_m: floor, mode, aspect,
|
||||
comparison_generation: comparisonGeneration, representation }) });
|
||||
if (!response.ok) throw new Error("Не удалось обновить вид облака.");
|
||||
const bytes = new Uint8Array(await response.arrayBuffer());
|
||||
|
||||
@@ -305,8 +305,6 @@
|
||||
}
|
||||
|
||||
.m4-replay-threat-visual__layer-with-settings > .nodedc-icon-button {
|
||||
width: 1.75rem;
|
||||
height: 1.75rem;
|
||||
border: 0;
|
||||
outline: 0;
|
||||
box-shadow: none;
|
||||
|
||||
@@ -439,7 +439,7 @@ export function E30EvidencePointCloud({ detail }: E30EvidencePointCloudProps) {
|
||||
<p className="e30-evidence-scene__error">{renderError}</p>
|
||||
) : null}
|
||||
</div>
|
||||
<div className="e30-evidence-scene__toolbar">
|
||||
<div className="e30-evidence-scene__toolbar nodedc-viewport-controls">
|
||||
<Button
|
||||
variant="secondary"
|
||||
size="compact"
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { Button } from "@nodedc/ui-react";
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import * as THREE from "three";
|
||||
import { OrbitControls } from "three/addons/controls/OrbitControls.js";
|
||||
@@ -591,8 +592,8 @@ export function LidarGroundPointCloud({
|
||||
<p className="lidar-ground-scene__error">{renderError}</p>
|
||||
) : null}
|
||||
</div>
|
||||
<div className="lidar-ground-scene__toolbar">
|
||||
<button type="button" onClick={resetCamera}>Сбросить ракурс</button>
|
||||
<div className="lidar-ground-scene__toolbar nodedc-viewport-controls">
|
||||
<Button onClick={resetCamera}>Сбросить ракурс</Button>
|
||||
<span>ЛКМ · вращение</span>
|
||||
<span>Колесо · масштаб</span>
|
||||
<span>ПКМ · панорама</span>
|
||||
|
||||
@@ -335,7 +335,7 @@ export function E34TemporalLayerScene({
|
||||
<p className="e34-temporal-scene__error">{renderError}</p>
|
||||
) : null}
|
||||
</div>
|
||||
<div className="e34-temporal-scene__toolbar">
|
||||
<div className="e34-temporal-scene__toolbar nodedc-viewport-controls">
|
||||
<Button
|
||||
variant="secondary"
|
||||
size="compact"
|
||||
|
||||
+1
-1
@@ -591,7 +591,7 @@ export function L34AnnotationWorkspace({
|
||||
: "L3.4"
|
||||
}`}
|
||||
>
|
||||
<header className="l34-annotation-workspace__toolbar">
|
||||
<header className="l34-annotation-workspace__toolbar nodedc-viewport-controls">
|
||||
<div className="l34-annotation-workspace__session-tools">
|
||||
<Select
|
||||
label="Сессия разметки"
|
||||
|
||||
+1
-1
@@ -372,7 +372,7 @@ export function L34FAdjudicationWorkspace({
|
||||
aria-modal="true"
|
||||
aria-label="Разбор конфликтов LAB L3.4F"
|
||||
>
|
||||
<header className="l34-annotation-workspace__toolbar">
|
||||
<header className="l34-annotation-workspace__toolbar nodedc-viewport-controls">
|
||||
<div className="l34-annotation-workspace__session-tools">
|
||||
<Select
|
||||
label="Сессия разбора конфликтов"
|
||||
|
||||
@@ -273,7 +273,7 @@ export function WorldMapWorkspace({
|
||||
/>
|
||||
) : null}
|
||||
|
||||
<div className="mission-map__map-actions" aria-label="Управление картой">
|
||||
<div className="mission-map__map-actions nodedc-viewport-controls" aria-label="Управление картой">
|
||||
<IconButton
|
||||
className="mission-map__map-action"
|
||||
label="Настройки карты"
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import {build} from 'esbuild';
|
||||
const result=await build({entryPoints:[new URL('../src/core/heightSlice.ts',import.meta.url).pathname],bundle:true,write:false,platform:'node',format:'esm'});
|
||||
const {heightSlice}=await import('data:text/javascript;base64,'+Buffer.from(result.outputFiles[0].contents).toString('base64'));
|
||||
test('each boundary independently disables clipping and fractional native rounding restores full scene',()=>{
|
||||
const bounds=[-51.4623,77.72065000000002];
|
||||
assert.deepEqual(heightSlice([-51.4623,77.72065],bounds),{floor:null,ceiling:null});
|
||||
assert.deepEqual(heightSlice([0,77.72065],bounds),{floor:0,ceiling:null});
|
||||
assert.deepEqual(heightSlice([-51.4623,20],bounds),{floor:null,ceiling:20});
|
||||
assert.deepEqual(heightSlice([2,20],bounds),{floor:2,ceiling:20});
|
||||
assert.deepEqual(heightSlice([2,2],bounds),{floor:2,ceiling:2});
|
||||
});
|
||||
@@ -2,7 +2,7 @@ import assert from "node:assert/strict";
|
||||
import { readFile } from "node:fs/promises";
|
||||
import { after, before, test } from "node:test";
|
||||
|
||||
import { createServer } from "vite";
|
||||
import { createServer } from "./support/vite-server.mjs";
|
||||
|
||||
let server;
|
||||
let mapView;
|
||||
@@ -217,7 +217,7 @@ test("map workspace keeps the canonical top actions without a bottom toolbar", a
|
||||
);
|
||||
|
||||
assert.doesNotMatch(source, /<Toolbar/);
|
||||
assert.match(source, /className="mission-map__map-actions"/);
|
||||
assert.match(source, /className="mission-map__map-actions nodedc-viewport-controls"/);
|
||||
assert.match(source, /label="Настройки карты"/);
|
||||
assert.match(source, /label="Слои карты"/);
|
||||
assert.doesNotMatch(source, /label="Сбросить камеру"/);
|
||||
|
||||
@@ -10,6 +10,8 @@ test('planning live scene reuses the canonical vertical height range inside the
|
||||
assert.match(source,/formatLimit=\{value=>value\.toFixed\(1\)\.replace\('\.',','\)\}/);
|
||||
assert.match(source,/heightBounds=null/);
|
||||
assert.match(source,/const CLIP_CEILING_M=80/);
|
||||
assert.match(source,/max:CLIP_CEILING_M/);
|
||||
assert.match(source,/setBounds\(next\);setCeiling\(null\);/);
|
||||
assert.match(source,/max:Math\.max\(CLIP_CEILING_M,sourceBounds\.max,ceiling\?\?-Infinity\)/);
|
||||
assert.match(source,/floor_m:floorRef\.current/);
|
||||
assert.match(source,/value=\{\[floor\?\?rangeBounds\.min,ceiling\?\?rangeBounds\.max\]\}/);
|
||||
assert.match(source,/floorRef\.current=null;setCeiling\(null\);setFloor\(null\);\s*\},\[runId\]\)/);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user