From 594de76ed51fd49fb79b912212bb0052a63e7671 Mon Sep 17 00:00:00 2001
From: feiyu02 <risaku@163.com>
Date: 星期四, 09 四月 2026 16:10:45 +0800
Subject: [PATCH] 2026.4.9

---
 src/main/kotlin/com/flightfeather/uav/model/epw/EPWDataPrep.kt |   29 +++++++++++++++++++++++++++--
 1 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/src/main/kotlin/com/flightfeather/uav/model/epw/EPWDataPrep.kt b/src/main/kotlin/com/flightfeather/uav/model/epw/EPWDataPrep.kt
index 40bfa5a..92cca2d 100644
--- a/src/main/kotlin/com/flightfeather/uav/model/epw/EPWDataPrep.kt
+++ b/src/main/kotlin/com/flightfeather/uav/model/epw/EPWDataPrep.kt
@@ -12,6 +12,7 @@
 import kotlin.math.min
 import kotlin.math.round
 import kotlin.math.sqrt
+import kotlin.time.times
 
 /**
  * 鏁版嵁骞虫粦棰勫鐞�
@@ -82,7 +83,7 @@
                 val it = mDataList[i].values?.get(y) ?: continue
 
                 if (!calTypes.contains(it.factorName)) continue
-                val vMax = FactorType.getVMax(it.factorName) ?: continue
+                val vMax = FactorType.getVMin(it.factorName) ?: continue
                 it.factorData ?: continue
 
                 if (it.factorData!! > vMax) {
@@ -148,9 +149,10 @@
             i = 0
         }
         while (i < mDataList.size) {
+            // 閽堝姣忎釜鐩戞祴鍥犲瓙锛屽垎鍒仛鏁版嵁骞虫粦澶勭悊
             for (y in mDataList[i].values?.indices ?: 0..0) {
                 val it = mDataList[i].values?.get(y) ?: continue
-                val vMax = FactorType.getVMax(it.factorName) ?: continue
+                val vMax = FactorType.getVMin(it.factorName) ?: continue
                 it.factorData ?: continue
 
                 if (it.factorData!! > vMax) {
@@ -192,6 +194,29 @@
                 }
             }
 
+            // 鏍规嵁鐗╃悊瑙勫緥锛屽墧闄ゆ垨淇涓嶅悎鐞嗙殑鏁版嵁
+            val data = mDataList[i]
+            // 1. PM2.5 搴旇濮嬬粓灏忎簬PM10
+            val pm25 = data.getFactorData(FactorType.PM25)
+            val pm10 = data.getFactorData(FactorType.PM10)
+            if (pm25 != null && pm10 != null) {
+                // 鑻m2.5澶т簬pm10
+                if (pm25 >= pm10){
+                    val lastIndex = i - 1
+                    // 鍒欏皢pm2.5淇敼涓哄墠涓�涓暟鎹殑鍊�
+                    if (lastIndex >= 0) {
+                        data.setFactorData(FactorType.PM25, mDataList[lastIndex].getFactorData(FactorType.PM25))
+                    } else {
+                        if (lastData.isEmpty()) {
+                            // 娌℃湁鍘嗗彶鏁版嵁鏃讹紝淇敼涓簆m10鐨�80%(鍚庣画寰呬紭鍖栨瘮渚� 2026.3.6)
+                            data.setFactorData(FactorType.PM25, data.getFactorData(FactorType.PM10)?.times(.8))
+                        } else {
+                            data.setFactorData(FactorType.PM25, lastData.last().getFactorData(FactorType.PM25))
+                        }
+                    }
+                }
+            }
+
             i++
         }
 

--
Gitblit v1.9.3