Browse Source

feat(NewDataFittingService):优化功率预测数据处理

- 在 NewDataFittingService 中更新 PowerFittingData 构造函数调用
- 在 PowerFittingData 中添加新的构造函数,支持模型 ID 参数
- 利用 CacheContext 中的 theoreticalPowerMap 进行功率预测
xushili 1 month ago
parent
commit
d88d0efa1e

+ 9 - 0
runeconomy-xk/src/main/java/com/gyee/runeconomy/model/PowerFittingData.java

@@ -1,6 +1,7 @@
 package com.gyee.runeconomy.model;
 
 import com.gyee.runeconomy.dto.speed.Desc;
+import com.gyee.runeconomy.init.CacheContext;
 import lombok.Data;
 
 /**
@@ -18,6 +19,14 @@ public class PowerFittingData {
             this.cpdata = ((double)((int)(Double.valueOf(str[2])*1000)))/1000;
         }
     }
+    public PowerFittingData(String[] str,String modleId) {
+        if (str.length >= 2){
+            this.speed = Double.valueOf(str[0]);
+            this.nhdata = Double.valueOf(str[1]);
+            this.xzdata = CacheContext.theoreticalPowerMap.get(modleId).get(this.speed).getEnsurePower();
+            this.cpdata = ((double)((int)(Double.valueOf(str[2])*1000)))/1000;
+        }
+    }
 
 
     //风速

+ 1 - 1
runeconomy-xk/src/main/java/com/gyee/runeconomy/service/auto/impl/NewDataFittingService.java

@@ -351,7 +351,7 @@ public class NewDataFittingService {
         ProEconPowerFittingAnalySis obj = proEconPowerFittingAnalySisService.selectItemById(id);
         List<String> ls = FileUtil.readFile(obj.getPath(), true);
         for (int i = 1; i < ls.size(); i++) {
-            PowerFittingData data = new PowerFittingData(ls.get(i).split(","));
+            PowerFittingData data = new PowerFittingData(ls.get(i).split(","),CacheContext.wtmap.get(obj.getWindturbineId()).getModelId());
             list.add(data);
         }