diff --git a/apps/control-station/src/components/laboratory/CanonicalRecordedLabReplay.tsx b/apps/control-station/src/components/laboratory/CanonicalRecordedLabReplay.tsx index 4be72478..68d2c73a 100644 --- a/apps/control-station/src/components/laboratory/CanonicalRecordedLabReplay.tsx +++ b/apps/control-station/src/components/laboratory/CanonicalRecordedLabReplay.tsx @@ -171,7 +171,7 @@ export function CanonicalRecordedLabReplay< > {splitView || paneToolbarsAlwaysVisible ? (
@@ -190,7 +190,7 @@ export function CanonicalRecordedLabReplay< > {splitView || paneToolbarsAlwaysVisible ? (
{spatialLeadingControl} diff --git a/apps/control-station/src/components/laboratory/LaboratoryEvidenceViewer.tsx b/apps/control-station/src/components/laboratory/LaboratoryEvidenceViewer.tsx index c6fba3cc..b1d90c4f 100644 --- a/apps/control-station/src/components/laboratory/LaboratoryEvidenceViewer.tsx +++ b/apps/control-station/src/components/laboratory/LaboratoryEvidenceViewer.tsx @@ -83,7 +83,7 @@ export function LaboratoryEvidenceViewer< }, [expanded, onExpandedChange]); const controls = ( -
+
{actions} {modeControlsVisible && secondaryMode ? ( {transport ? ( -
+
{transport}
) : null} @@ -149,7 +149,7 @@ export function LaboratoryEvidenceViewer<
{overlay} {transport ? ( -
+
{transport}
) : null} diff --git a/apps/control-station/src/components/laboratory/LaboratoryReviewWorkspaceFrame.tsx b/apps/control-station/src/components/laboratory/LaboratoryReviewWorkspaceFrame.tsx index 5a4fca4f..9e4c1f9e 100644 --- a/apps/control-station/src/components/laboratory/LaboratoryReviewWorkspaceFrame.tsx +++ b/apps/control-station/src/components/laboratory/LaboratoryReviewWorkspaceFrame.tsx @@ -101,7 +101,7 @@ export function LaboratoryReviewWorkspaceFrame({ keepFocusInside(event, event.currentTarget); }} > -
{toolbar}
+
{toolbar}
{stage}
{inspector ?
{inspector}
: null} {overlays} diff --git a/apps/control-station/src/components/missions/PlanningLiveScene.tsx b/apps/control-station/src/components/missions/PlanningLiveScene.tsx index 6486c9c3..25b242d9 100644 --- a/apps/control-station/src/components/missions/PlanningLiveScene.tsx +++ b/apps/control-station/src/components/missions/PlanningLiveScene.tsx @@ -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(null); + const floorRef=useRef(null); const boundsRef=useRef<{min:number;max:number}|null>(null); const host=useRef(null); const [state,setState]=useState('loading'),[retry,setRetry]=useState(0); const [bounds,setBounds]=useState<{min:number;max:number}|null>(null); const [ceiling,setCeiling]=useState(null); + const [floor,setFloor]=useState(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.currentnext.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
{rangeBounds&&state==='ready'&&
- `${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); }}/>
} {state==='error'&&
Обновление сцены недоступно.
} diff --git a/apps/control-station/src/components/observation/ObservationDeck.tsx b/apps/control-station/src/components/observation/ObservationDeck.tsx index f55a6344..0bbfb2f3 100644 --- a/apps/control-station/src/components/observation/ObservationDeck.tsx +++ b/apps/control-station/src/components/observation/ObservationDeck.tsx @@ -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
; } -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;layout:ObservationLayout;onTreeChange:(tree:DockTree)=>void; - labels:Record;focusedId?:string|null;children:ReactNode; + minimumSizes?:Record; labels:Record;focusedId?:string|null;children:ReactNode; }){ return ({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=>}>{children}; } diff --git a/apps/control-station/src/components/observation/ObservationPanelHeader.tsx b/apps/control-station/src/components/observation/ObservationPanelHeader.tsx index 356dd74d..9dcb91c9 100644 --- a/apps/control-station/src/components/observation/ObservationPanelHeader.tsx +++ b/apps/control-station/src/components/observation/ObservationPanelHeader.tsx @@ -9,5 +9,5 @@ export function ObservationPanelHeader({children}:{children:ReactNode}) { measure();const observer=new ResizeObserver(measure);observer.observe(header); return()=>observer.disconnect(); },[]); - return
{children}
; + return
{children}
; } diff --git a/apps/control-station/src/components/observation/SessionOverviewScene.tsx b/apps/control-station/src/components/observation/SessionOverviewScene.tsx index e5baa3c5..140ecede 100644 --- a/apps/control-station/src/components/observation/SessionOverviewScene.tsx +++ b/apps/control-station/src/components/observation/SessionOverviewScene.tsx @@ -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(null); const [ceiling, setCeiling] = useState(null); + const [floor, setFloor] = useState(null); const [mode, setMode] = useState("3d"); const [viewError, setViewError] = useState(null); const [visiblePoints, setVisiblePoints] = useState(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 <> -
{!hideTitle&&

Облако и траектория

} +
{!hideTitle&&

Облако и траектория

} {compareVersions && comparison && }
{low != null && high != null && high > low && state === "ready" &&
- `${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); }} />
} {state === "error" &&
Не удалось открыть облако.
} {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 && <>
Выборка для просмотра. Исходная запись сохранена отдельно.}
{viewError &&
{viewError}
} diff --git a/apps/control-station/src/components/observation/observation.css b/apps/control-station/src/components/observation/observation.css index 98ebb763..ef9e4d3a 100644 --- a/apps/control-station/src/components/observation/observation.css +++ b/apps/control-station/src/components/observation/observation.css @@ -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)); } diff --git a/apps/control-station/src/core/heightSlice.ts b/apps/control-station/src/core/heightSlice.ts new file mode 100644 index 00000000..4afd874d --- /dev/null +++ b/apps/control-station/src/core/heightSlice.ts @@ -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 }; +} diff --git a/apps/control-station/src/core/missions/PlanningTestContext.tsx b/apps/control-station/src/core/missions/PlanningTestContext.tsx index 3e7f1be7..78e558ed 100644 --- a/apps/control-station/src/core/missions/PlanningTestContext.tsx +++ b/apps/control-station/src/core/missions/PlanningTestContext.tsx @@ -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 & {route:Omit}; 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; const poll=async()=>{ const expected=generation.current; - try { const next=await plannerRequest(endpoint+'/active'); if(!disposed && expected===generation.current) {setTest(next);setPollError(null);} } + try { const next=await plannerRequest(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);}; diff --git a/apps/control-station/src/core/observation/sessionOverviewSpatial.ts b/apps/control-station/src/core/observation/sessionOverviewSpatial.ts index 145c2cde..3846c6c2 100644 --- a/apps/control-station/src/core/observation/sessionOverviewSpatial.ts +++ b/apps/control-station/src/core/observation/sessionOverviewSpatial.ts @@ -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()); diff --git a/apps/control-station/src/styles/m4-replay-threat.css b/apps/control-station/src/styles/m4-replay-threat.css index e0996777..c3d8303b 100644 --- a/apps/control-station/src/styles/m4-replay-threat.css +++ b/apps/control-station/src/styles/m4-replay-threat.css @@ -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; diff --git a/apps/control-station/src/workspaces/E30EvidencePointCloud.tsx b/apps/control-station/src/workspaces/E30EvidencePointCloud.tsx index a4b38649..dc2c26d5 100644 --- a/apps/control-station/src/workspaces/E30EvidencePointCloud.tsx +++ b/apps/control-station/src/workspaces/E30EvidencePointCloud.tsx @@ -439,7 +439,7 @@ export function E30EvidencePointCloud({ detail }: E30EvidencePointCloudProps) {

{renderError}

) : null}
-
+
-
- +
+ ЛКМ · вращение Колесо · масштаб ПКМ · панорама diff --git a/apps/control-station/src/workspaces/laboratory/E34TemporalLayerScene.tsx b/apps/control-station/src/workspaces/laboratory/E34TemporalLayerScene.tsx index 4649cbe4..681c364b 100644 --- a/apps/control-station/src/workspaces/laboratory/E34TemporalLayerScene.tsx +++ b/apps/control-station/src/workspaces/laboratory/E34TemporalLayerScene.tsx @@ -335,7 +335,7 @@ export function E34TemporalLayerScene({

{renderError}

) : null}
-
+
-