Browse Source

偏航角度修改

王波 3 weeks ago
parent
commit
cc585c9a37

+ 2 - 1
runeconomy-xk/src/main/java/com/gyee/runeconomy/service/WindDirection/WindALG.java

@@ -356,7 +356,8 @@ public class WindALG {
                 PowerPointData item = list.get(i);
                 Integer speed = Math.toIntExact(Math.round(item.getSpeed()));
 //                int ele = (int) (Math.abs(item.getFx()) + Math.abs(item.getAngle()));
-                int ele = (int) (Math.abs(item.getFx()) + (Math.abs(item.getAngle()) - item.getFx()));//此处叶片1为机舱位置
+//                int ele = (int) (Math.abs(item.getFx()) + (Math.abs(item.getAngle()) - item.getFx()));//此处偏航角度为机舱位置
+                int ele = (int) (Math.abs(item.getFx()));
                 int index = ele - 180;
                 if (index >= -30 && index <= 30 && item.getPower() > 0) {
                     avg += index;

+ 141 - 141
runeconomy-xk/src/main/java/com/gyee/runeconomy/service/WindDirection/WindDirectionService.java

@@ -55,7 +55,7 @@ public class WindDirectionService {
         // 获取历史数据
         Map<EquipmentPointType, List<TsDoubleData>> historyData = points.entrySet().stream()
                 .collect(Collectors.toMap(Map.Entry::getKey,
-                        entry -> getSortedHistory(entry.getValue(), startDate.getTime(), endDate.getTime(), 600)));
+                        entry -> getSortedHistory(entry.getValue(), startDate.getTime(), endDate.getTime(), 300)));
 
         // 创建时间戳到数据的映射表
         Map<Long, TsDoubleData> pjfsMap = historyData.get(EquipmentPointType.PJFS).stream()
@@ -87,8 +87,8 @@ public class WindDirectionService {
 
             PowerPointData data = new PowerPointData();
             data.setTime(DateUtils.formatTimestamp(ts));
-            if (fxData.getDoubleValue() < 0) {
-                data.setFx(Math.abs(fxData.getDoubleValue()));//风向为负取绝对值
+          if (collect.size()>0){
+                data.setFx(fxData.getDoubleValue() * 57.2958);
             } else {
                 data.setFx(fxData.getDoubleValue());
             }
@@ -137,7 +137,7 @@ public class WindDirectionService {
         Double mins = 3.0;
         Double maxs = 25.0;
         Double minp = 0.0;
-        Double maxp = 0.0;
+        Double maxp = 3000.0;
         Boolean isfhl =true;
         Boolean isbw =true;
         Boolean istj =true;
@@ -166,11 +166,11 @@ public class WindDirectionService {
             }
 
             //过滤限电状态,风机状态等于4或者5
-            if (xd == 1 && filter == 0 && isfbw && (item.getMxzt() == 8 || item.getMxzt() == 9)) {
-                filter = 1;
-                fjstatus = 1;
-                timeBW = item.getTime();
-            }
+//            if (xd == 1 && filter == 0 && isfbw && (item.getMxzt() == 8 || item.getMxzt() == 9)) {
+//                filter = 1;
+//                fjstatus = 1;
+//                timeBW = item.getTime();
+//            }
             // 按给定风速功率过滤
             if (item.getSpeed() < mins || item.getSpeed() > maxs || item.getPower() < minp || item.getPower() > maxp) {
                 filter = 1;
@@ -180,69 +180,69 @@ public class WindDirectionService {
                 filter = 1;
             }
             // 过滤并网后十分钟
-            if (filter == 0 && isbw) {
-                if (DateUtil.getTimeDiff(item.getTime(), timeBW) <= 10)
-                    filter = 1;
-            }
+//            if (filter == 0 && isbw) {
+//                if (DateUtil.getTimeDiff(item.getTime(), timeBW) <= 10)
+//                    filter = 1;
+//            }
             // 过滤停机前十分钟
-            if (istj) {
-                if (fjstatus == 0) {
-                    if (tempei.size() > 0) {
-                        if (DateUtil.getTimeDiff(tempei.get(0).getTime(), timeBW) >= 10) {
-                            tempei.remove(0);
-                        }
-                    }
-                    tempei.add(item);
-                } else {
-                    for (PowerPointData temp : tempei) {
-                        temp.setFilter(1);
-                    }
-                    tempei.clear();
-                }
-            }
+//            if (istj) {
+//                if (fjstatus == 0) {
+//                    if (tempei.size() > 0) {
+//                        if (DateUtil.getTimeDiff(tempei.get(0).getTime(), timeBW) >= 10) {
+//                            tempei.remove(0);
+//                        }
+//                    }
+//                    tempei.add(item);
+//                } else {
+//                    for (PowerPointData temp : tempei) {
+//                        temp.setFilter(1);
+//                    }
+//                    tempei.clear();
+//                }
+//            }
             //欠发
-            if (filter == 0 && item.getSpeed() >= 6 && item.getSpeed() < 12.5 && isqfh && qfhdj < item.getQfzt()) {
-                filter = 1;
-                for (PowerPointData temp : tempqf) {
-                    temp.setFilter(1);
-                }
-            } else if (filter == 0 && item.getSpeed() >= 12.5 && isqfh && qfhdj < 1) {
-                filter = 1;
-                for (PowerPointData temp : tempqf) {
-                    temp.setFilter(1);
-                }
-            }
-            if (tempqf.size() > 0) {
-                if (DateUtil.getTimeDiff(tempqf.get(0).getTime(), item.getTime()) >= 5) {
-                    tempqf.remove(0);
-                }
-            }
-            tempqf.add(0, item);
-            item.setFilter(filter);
+//            if (filter == 0 && item.getSpeed() >= 6 && item.getSpeed() < 12.5 && isqfh && qfhdj < item.getQfzt()) {
+//                filter = 1;
+//                for (PowerPointData temp : tempqf) {
+//                    temp.setFilter(1);
+//                }
+//            } else if (filter == 0 && item.getSpeed() >= 12.5 && isqfh && qfhdj < 1) {
+//                filter = 1;
+//                for (PowerPointData temp : tempqf) {
+//                    temp.setFilter(1);
+//                }
+//            }
+//            if (tempqf.size() > 0) {
+//                if (DateUtil.getTimeDiff(tempqf.get(0).getTime(), item.getTime()) >= 5) {
+//                    tempqf.remove(0);
+//                }
+//            }
+//            tempqf.add(0, item);
+//            item.setFilter(filter);
 
             //功率曲线偏差
-            if (isglpc) {
-                if (modelPowerMap.containsKey(item.getSpeed())) {
-
-                    double power = modelPowerMap.get(item.getSpeed());  //不同风速对应的保证功率
-                    double k = item.getPower() / power;  //保证功率/实际功率   k:偏差百分比
-                    if (item.getPower() > 0) {
-                        if (k < 0.95 && maxPower <= power) {
-                            item.setFilter(1);
-                        }
-                        if (k < 0.9 && maxPower > power) {
-                            item.setFilter(1);
-                        }
-                        if (k < 0.85 && item.getSpeed() < 6 && item.getSpeed() > 4) {
-                            item.setFilter(1);
-                        }
-
-                        if (k < 0.9 && item.getSpeed() <= 4 && item.getSpeed() > 3.5) {
-                            item.setFilter(1);
-                        }
-                    }
-                }
-            }
+//            if (isglpc) {
+//                if (modelPowerMap.containsKey(item.getSpeed())) {
+//
+//                    double power = modelPowerMap.get(item.getSpeed());  //不同风速对应的保证功率
+//                    double k = item.getPower() / power;  //保证功率/实际功率   k:偏差百分比
+//                    if (item.getPower() > 0) {
+//                        if (k < 0.95 && maxPower <= power) {
+//                            item.setFilter(1);
+//                        }
+//                        if (k < 0.9 && maxPower > power) {
+//                            item.setFilter(1);
+//                        }
+//                        if (k < 0.85 && item.getSpeed() < 6 && item.getSpeed() > 4) {
+//                            item.setFilter(1);
+//                        }
+//
+//                        if (k < 0.9 && item.getSpeed() <= 4 && item.getSpeed() > 3.5) {
+//                            item.setFilter(1);
+//                        }
+//                    }
+//                }
+//            }
         }
 
 
@@ -292,7 +292,7 @@ public class WindDirectionService {
         // 获取历史数据
         Map<EquipmentPointType, List<TsDoubleData>> historyData = points.entrySet().stream()
                 .collect(Collectors.toMap(Map.Entry::getKey,
-                        entry -> getSortedHistory(entry.getValue(), startDate.getTime(), endDate.getTime(), 600)));
+                        entry -> getSortedHistory(entry.getValue(), startDate.getTime(), endDate.getTime(), 300)));
 
         // 创建时间戳到数据的映射表
         Map<Long, TsDoubleData> pjfsMap = historyData.get(EquipmentPointType.PJFS).stream()
@@ -324,8 +324,8 @@ public class WindDirectionService {
 
             PowerPointData data = new PowerPointData();
             data.setTime(DateUtils.formatTimestamp(ts));
-            if (fxData.getDoubleValue() < 0) {
-                data.setFx(Math.abs(fxData.getDoubleValue()));
+            if (equipments.size() > 0) {
+                data.setFx(fxData.getDoubleValue() * 57.2958);
             } else {
                 data.setFx(fxData.getDoubleValue());
             }
@@ -374,7 +374,7 @@ public class WindDirectionService {
         Double mins = 3.0;
         Double maxs = 25.0;
         Double minp = 0.0;
-        Double maxp = 0.0;
+        Double maxp = 3000.0;
         Boolean isfhl =true;
         Boolean isbw =true;
         Boolean istj =true;
@@ -403,12 +403,12 @@ public class WindDirectionService {
             }
 
             //过滤限电状态,风机状态等于4或者5
-            if (xd == 1 && filter == 0 && isfbw && (item.getMxzt() == 8 || item.getMxzt() == 9)) {
-                filter = 1;
-                fjstatus = 1;
-                timeBW = item.getTime();
-            }
-            // 按给定风速功率过滤
+//            if (xd == 1 && filter == 0 && isfbw && (item.getMxzt() == 8 || item.getMxzt() == 9)) {
+//                filter = 1;
+//                fjstatus = 1;
+//                timeBW = item.getTime();
+//            }
+//            // 按给定风速功率过滤
             if (item.getSpeed() < mins || item.getSpeed() > maxs || item.getPower() < minp || item.getPower() > maxp) {
                 filter = 1;
             }
@@ -417,69 +417,69 @@ public class WindDirectionService {
                 filter = 1;
             }
             // 过滤并网后十分钟
-            if (filter == 0 && isbw) {
-                if (DateUtil.getTimeDiff(item.getTime(), timeBW) <= 10)
-                    filter = 1;
-            }
-            // 过滤停机前十分钟
-            if (istj) {
-                if (fjstatus == 0) {
-                    if (tempei.size() > 0) {
-                        if (DateUtil.getTimeDiff(tempei.get(0).getTime(), timeBW) >= 10) {
-                            tempei.remove(0);
-                        }
-                    }
-                    tempei.add(item);
-                } else {
-                    for (PowerPointData temp : tempei) {
-                        temp.setFilter(1);
-                    }
-                    tempei.clear();
-                }
-            }
-            //欠发
-            if (filter == 0 && item.getSpeed() >= 6 && item.getSpeed() < 12.5 && isqfh && qfhdj < item.getQfzt()) {
-                filter = 1;
-                for (PowerPointData temp : tempqf) {
-                    temp.setFilter(1);
-                }
-            } else if (filter == 0 && item.getSpeed() >= 12.5 && isqfh && qfhdj < 1) {
-                filter = 1;
-                for (PowerPointData temp : tempqf) {
-                    temp.setFilter(1);
-                }
-            }
-            if (tempqf.size() > 0) {
-                if (DateUtil.getTimeDiff(tempqf.get(0).getTime(), item.getTime()) >= 5) {
-                    tempqf.remove(0);
-                }
-            }
-            tempqf.add(0, item);
-            item.setFilter(filter);
-
-            //功率曲线偏差
-            if (isglpc) {
-                if (modelPowerMap.containsKey(item.getSpeed())) {
-
-                    double power = modelPowerMap.get(item.getSpeed());  //不同风速对应的保证功率
-                    double k = item.getPower() / power;  //保证功率/实际功率   k:偏差百分比
-                    if (item.getPower() > 0) {
-                        if (k < 0.95 && maxPower <= power) {
-                            item.setFilter(1);
-                        }
-                        if (k < 0.9 && maxPower > power) {
-                            item.setFilter(1);
-                        }
-                        if (k < 0.85 && item.getSpeed() < 6 && item.getSpeed() > 4) {
-                            item.setFilter(1);
-                        }
-
-                        if (k < 0.9 && item.getSpeed() <= 4 && item.getSpeed() > 3.5) {
-                            item.setFilter(1);
-                        }
-                    }
-                }
-            }
+//            if (filter == 0 && isbw) {
+//                if (DateUtil.getTimeDiff(item.getTime(), timeBW) <= 10)
+//                    filter = 1;
+//            }
+//            // 过滤停机前十分钟
+//            if (istj) {
+//                if (fjstatus == 0) {
+//                    if (tempei.size() > 0) {
+//                        if (DateUtil.getTimeDiff(tempei.get(0).getTime(), timeBW) >= 10) {
+//                            tempei.remove(0);
+//                        }
+//                    }
+//                    tempei.add(item);
+//                } else {
+//                    for (PowerPointData temp : tempei) {
+//                        temp.setFilter(1);
+//                    }
+//                    tempei.clear();
+//                }
+//            }
+//            //欠发
+//            if (filter == 0 && item.getSpeed() >= 6 && item.getSpeed() < 12.5 && isqfh && qfhdj < item.getQfzt()) {
+//                filter = 1;
+//                for (PowerPointData temp : tempqf) {
+//                    temp.setFilter(1);
+//                }
+//            } else if (filter == 0 && item.getSpeed() >= 12.5 && isqfh && qfhdj < 1) {
+//                filter = 1;
+//                for (PowerPointData temp : tempqf) {
+//                    temp.setFilter(1);
+//                }
+//            }
+//            if (tempqf.size() > 0) {
+//                if (DateUtil.getTimeDiff(tempqf.get(0).getTime(), item.getTime()) >= 5) {
+//                    tempqf.remove(0);
+//                }
+//            }
+//            tempqf.add(0, item);
+//            item.setFilter(filter);
+//
+//            //功率曲线偏差
+//            if (isglpc) {
+//                if (modelPowerMap.containsKey(item.getSpeed())) {
+//
+//                    double power = modelPowerMap.get(item.getSpeed());  //不同风速对应的保证功率
+//                    double k = item.getPower() / power;  //保证功率/实际功率   k:偏差百分比
+//                    if (item.getPower() > 0) {
+//                        if (k < 0.95 && maxPower <= power) {
+//                            item.setFilter(1);
+//                        }
+//                        if (k < 0.9 && maxPower > power) {
+//                            item.setFilter(1);
+//                        }
+//                        if (k < 0.85 && item.getSpeed() < 6 && item.getSpeed() > 4) {
+//                            item.setFilter(1);
+//                        }
+//
+//                        if (k < 0.9 && item.getSpeed() <= 4 && item.getSpeed() > 3.5) {
+//                            item.setFilter(1);
+//                        }
+//                    }
+//                }
+//            }
         }