|
@@ -1,9 +1,35 @@
|
|
|
import { EventAction, getFont, Pen } from "@meta2d/core";
|
|
|
import { MonitoringPointData } from "@/types";
|
|
|
|
|
|
+const enum MonitorPointStatus {
|
|
|
+ /**
|
|
|
+ * 离线
|
|
|
+ */
|
|
|
+ Offline = -1,
|
|
|
+ /**
|
|
|
+ * 关闭
|
|
|
+ */
|
|
|
+ Closed = 0,
|
|
|
+ /**
|
|
|
+ * 正常
|
|
|
+ */
|
|
|
+ Normal = 1,
|
|
|
+ /**
|
|
|
+ * 预警
|
|
|
+ */
|
|
|
+ Warning = 2,
|
|
|
+ /**
|
|
|
+ * 超标
|
|
|
+ */
|
|
|
+ Exceed = 3,
|
|
|
+}
|
|
|
+
|
|
|
const isPointNormal = (point: MonitoringPointData) => {
|
|
|
- const { temperature, humidity } = point;
|
|
|
- return temperature !== null && humidity !== null;
|
|
|
+ const { status } = point;
|
|
|
+ return (
|
|
|
+ status !== MonitorPointStatus.Warning &&
|
|
|
+ status !== MonitorPointStatus.Exceed
|
|
|
+ );
|
|
|
};
|
|
|
|
|
|
export interface MonitorPointPen extends Pen {
|