export interface Domain { // 系统名称 name: string; // 系统包含的设备类型 categories: string[]; // 系统的Logo logo: string; } export interface Sensor { // 传感器名称 name: string; /** * 传感器数值类型 * bool: 布尔类型, 展示内容从dictionary中获取 * enum: 枚举类型, 展示内容从dictionary中获取 * string: 字符串类型, 直接展示数据 * number: 数值类型, 展示数据和单位,并显示精度 */ type: 'bool' | 'enum' | 'string' | 'number'; // 传感器单位 unit?: string; // 传感器数据精度, 只有数值类型的传感器有精度 precision?: number; // 传感器类型映射表 dictionary: { [key: string]: string; }; } export interface ThresholdLimit { sensorType: string; condition: string; limit: number[]; [proName: string]: any; } // 设备子类型 export interface DeviceSubtypeInfo { // 设备型号 model: string; // 归属的设备类型 category: string; // 设备包含的传感器 sensorTypes: string[]; // 协议协议 protocolType: 'alpha' | 'cellular'; // 传感器支持的操作 operations: { type: string; name: string; }[]; settingOperations: { type: string; name: string; firmwareVersions: string[]; }[]; // 该操作支持的固件版本区间 // 第一位表示从某个版本开始支持此功能, 第二位表示到某个版本不支持此操作 // 一般数组只有一个元素, 平台这边基本都会从某个版本一直支持 firmwareVersions: [string, string?]; thresholdLimits: ThresholdLimit[]; } // 设备类型 export interface DeviceTypeInfo { // 设备类型名称 name: string; // logo图片 logo: string; // 包含的子类型 types: string[]; domain: string; } // 设备事件字典配置 export interface DeviceEventDictionary { categoryDictionary: { // 预警: ALARM 故障: FAULT [key: string]: string; }; // 事件类型配置字典 typeDictionary: { [key: string]: string; }; // 事件类型描述的配置字典 infoDictionary: { [key: string]: string; }; } export interface ActionEventType { type: string; name: string; freeze: boolean; } export interface RuleEngineConfig { conditionOpArr: { key: string; name: string; }[]; relatedTypeArr: { key: string; name: string; }[]; actionMap: { [key: string]: { type: string; name: string; freeze: boolean; triggerEvents: ActionEventType[]; }; }; triggerEventMap: { [key: string]: { type: string; name: string; freeze: boolean; actionTypes: ActionEventType[]; }; }; }