From 9ed0b1847912221197697791d69e01ccae17f5b9 Mon Sep 17 00:00:00 2001
From: feiyu02 <risaku@163.com>
Date: 星期二, 27 八月 2024 17:36:11 +0800
Subject: [PATCH] 1. 新增NO监测因子 2. 新增第三方数据接口数据获取相关模块

---
 src/main/kotlin/com/flightfeather/uav/socket/eunm/FactorType.kt |   32 ++++++++++++++++++++++++++++++++
 1 files changed, 32 insertions(+), 0 deletions(-)

diff --git a/src/main/kotlin/com/flightfeather/uav/socket/eunm/FactorType.kt b/src/main/kotlin/com/flightfeather/uav/socket/eunm/FactorType.kt
index 81c0d6f..5ae4e9f 100644
--- a/src/main/kotlin/com/flightfeather/uav/socket/eunm/FactorType.kt
+++ b/src/main/kotlin/com/flightfeather/uav/socket/eunm/FactorType.kt
@@ -1,5 +1,7 @@
 package com.flightfeather.uav.socket.eunm
 
+import com.flightfeather.uav.biz.dataanalysis.BaseExceptionAnalysis
+
 /**
  * @author riku
  * Date: 2020/6/10
@@ -26,7 +28,23 @@
 
     companion object {
 
+        /**
+         * 閫氳繃绱㈠紩鑾峰彇鏋氫妇绫诲瀷锛岀敤浜庢暟鎹垎鏋�
+         * @see [BaseExceptionAnalysis]
+         */
         fun getByIndex(index: Int): FactorType? = when (index) {
+            0 -> NO2
+            1 -> CO
+            2 -> H2S
+            3 -> SO2
+            4 -> O3
+            5 -> PM25
+            6 -> PM10
+            7 -> VOC
+            else -> null
+        }
+
+        fun getByValue(value: Int): FactorType? = when (value) {
             NO2.value -> NO2
             CO.value -> CO
             H2S.value -> H2S
@@ -134,6 +152,20 @@
             else -> null
         }
 
+        fun getMultiplier(name: String?): Double {
+            getByName(name)?.let {
+                return getMultiplier(it)
+            }
+            return 10.0
+        }
+
+        fun getMultiplier(type: FactorType): Double = when (type) {
+            PM25 -> 20.0
+            PM10 -> 20.0
+            VOC -> 10.0
+            else -> 10.0
+        }
+
         fun outputFactor(factorName: String?): Boolean {
             return when (factorName) {
                 NO2.des,

--
Gitblit v1.9.3