feat(observation): expose offline sources with transparent viewport headers
This commit is contained in:
@@ -12,10 +12,12 @@ export interface SensorObservationProps {
|
||||
export interface SensorObservationContribution {
|
||||
views:(device:Sensor)=>SensorObservationView[];
|
||||
Session:ComponentType<SensorObservationProps>;
|
||||
catalog?:{label:string;views:SensorObservationView[]};
|
||||
}
|
||||
export const sensorLayerLabels:Record<string,string>={color:'RGB',depth:'Глубина',infrared1:'ИК · 1',infrared2:'ИК · 2',points:'Облако точек',motion:'Движение'};
|
||||
export function cameraObservationViews(device:Sensor):SensorObservationView[] {
|
||||
const layers=device.layers.filter(value=>Object.hasOwn(sensorLayerLabels,value)).map(value=>({value,label:sensorLayerLabels[value]}));
|
||||
const published=device.layers.length?device.layers:/^RealSense D455$/i.test(device.model??'')?['color','depth','infrared1','infrared2','points','motion']:[];
|
||||
const layers=published.filter(value=>Object.hasOwn(sensorLayerLabels,value)).map(value=>({value,label:sensorLayerLabels[value]}));
|
||||
layers.sort((a,b)=>Number(b.value==='color')-Number(a.value==='color'));
|
||||
return layers.length?[{id:'camera',label:device.name,layers}]:[];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user