|
@@ -8,6 +8,8 @@ import lombok.val;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
+import java.math.BigDecimal;
|
|
|
+import java.math.RoundingMode;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
@@ -22,7 +24,7 @@ public class BladeService {
|
|
|
* @param ids
|
|
|
* @return
|
|
|
*/
|
|
|
- public Object bladeData(String ids){
|
|
|
+ public Object bladeAngle(String ids){
|
|
|
Map<String, Object> result = new HashMap<>();
|
|
|
List<Powerfittinganalysis> list = powerService.selectListByIds(ids);
|
|
|
if (list.size() == 0)
|
|
@@ -45,6 +47,9 @@ public class BladeService {
|
|
|
mp.put("yp1", p1);
|
|
|
mp.put("yp2", p2);
|
|
|
mp.put("yp3", p3);
|
|
|
+ mp.put("c12", curveDeviation(p1, p2));
|
|
|
+ mp.put("c13", curveDeviation(p1, p3));
|
|
|
+ mp.put("c23", curveDeviation(p2, p3));
|
|
|
mp.put("wt", obj.getWindturbine());
|
|
|
if (time.size() == 0)
|
|
|
time.addAll(ls.stream().map(m -> m.getTime()).collect(Collectors.toList()));
|
|
@@ -56,6 +61,24 @@ public class BladeService {
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
+ public Object bladeAnalysis(String ids){
|
|
|
+ Map<String, Object> result = new HashMap<>();
|
|
|
+ List<Powerfittinganalysis> list = powerService.selectListByIds(ids);
|
|
|
+ if (list.size() == 0)
|
|
|
+ return result;
|
|
|
+
|
|
|
+ for (int i = 0; i < list.size(); i++) {
|
|
|
+ Powerfittinganalysis obj = list.get(i);
|
|
|
+ List<PowerPointData> ls = csvParse(obj);
|
|
|
+ for (PowerPointData item : ls) {
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* csv 文件解析成对象
|
|
|
* @param obj
|
|
@@ -73,4 +96,26 @@ public class BladeService {
|
|
|
return list;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 计算叶片的曲线偏差率
|
|
|
+ * @param ls1
|
|
|
+ * @param ls2
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private double curveDeviation(List<Double> ls1, List<Double> ls2){
|
|
|
+ double result = 0;
|
|
|
+ if (ls1.size() == 0 || ls1.size() != ls2.size())
|
|
|
+ return result;
|
|
|
+
|
|
|
+ double count = 0;
|
|
|
+ for (int i = 0; i < ls1.size(); i++){
|
|
|
+ double diff = ls1.get(i) - ls2.get(i);
|
|
|
+ double v = ls2.get(i) != 0 ? diff / ls2.get(i) * 100 : diff;
|
|
|
+ count += v;
|
|
|
+ }
|
|
|
+ result = new BigDecimal(count / ls1.size()).setScale(2, RoundingMode.FLOOR).doubleValue();
|
|
|
+
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
}
|