import {CssType, HtmlPanel} from '@deep/engine'; /** * 传感器面板类 */ export class SensorModal extends HtmlPanel { private sensorData: { sensors: Array<{ type: string; channel: number; position: { x: number; y: number; z: number; }; }>; } = { sensors: [] }; /** * 构造函数 * @param type CSS渲染类型 */ constructor(type: CssType = CssType.CSS3D) { super(type); this.updateContentFromData(); } /** * 更新传感器数据 * @param data 新的传感器数据 */ updateData(data: { sensors: Array<{ type: string; channel: number; position: { x: number; y: number; z: number; }; }>; }): void { this.sensorData = data; this.updateContentFromData(); } /** * 根据数据更新弹窗内容 */ private updateContentFromData(): void { // 使用 cssObject 的 uuid 作为唯一标识 作为 关闭按键的id const cssObject = this.getCssObject(); const closeButtonId = cssObject.uuid; const content = `
暂无传感器数据
' }