فهرست منبع

对风偏差数据修改

王波 2 هفته پیش
والد
کامیت
08a89d95bb

+ 9 - 6
runeconomy-xk/src/main/java/com/gyee/runeconomy/service/WindDirection/WindALG.java

@@ -303,9 +303,10 @@ public class WindALG {
 //            if (equipments.size()>0) {
 //                dfwc = Math.abs(item.getDfwc()) * 57.2958;//对风误差进行弧度转角度
 //            } else {
-                dfwc = Math.abs(item.getDfwc());
+//                dfwc = Math.abs(item.getDfwc());
+                dfwc =item.getDfwc() * 57.2958;
 //            }
-            int ele = (int)Math.round((item.getFx() + dfwc));
+            int ele = (int)Math.round(item.getFx() + dfwc);
             int index = ele - 180;
             if (index >= -50 && index <= 50 && item.getSpeed() > 0) {
                 double key = Math.abs(index) + item.getSpeed();
@@ -355,9 +356,9 @@ public class WindALG {
             for (int i = 0; i < list.size(); i++){
                 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()));
 //                int ele = (int) (Math.abs(item.getFx()) + (Math.abs(item.getAngle()) - item.getFx()));//此处偏航角度为机舱位置
-                int ele = (int) (Math.abs(item.getFx()));
+//                int ele = (int) (Math.abs(item.getFx()));
                 int index = ele - 180;
                 if (index >= -30 && index <= 30 && item.getPower() > 0) {
                     avg += index;
@@ -395,11 +396,13 @@ public class WindALG {
 //                dfwc = Math.abs(item.getDfwc()) * 57.2958;
 //                dfwcls.add(dfwc);
 //            } else {
-                dfwc = Math.abs(item.getDfwc());
+//                dfwc = Math.abs(item.getDfwc());
+                dfwc = item.getDfwc() * 57.2958;
                 dfwcls.add(dfwc);
 //            }
             fxls.add(item.getFx());
-            int ele = (int) (Math.abs(item.getFx()) + dfwc);
+//            int ele = (int) (Math.abs(item.getFx()) + dfwc);
+            int ele = (int) (item.getFx() + dfwc);
             int index = ele - 180;
             if (index >= -50 && index <= 50)
                 pc[50-(index > 0 ? -index : Math.abs(index))]++;

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

@@ -100,11 +100,11 @@ public class WindDirectionService {
 
             PowerPointData data = new PowerPointData();
             data.setTime(DateUtils.formatTimestamp(ts));
-          if (collect.size()>0){
-                data.setFx(fxData.getDoubleValue() * 57.2958);
-            } else {
-                data.setFx(fxData.getDoubleValue());
-            }
+//          if (collect.size()>0){
+//                data.setFx(fxData.getDoubleValue() * 57.2958);
+//            } else {
+//                data.setFx(fxData.getDoubleValue());
+//            }
             data.setSpeed(fsData != null ? fsData.getDoubleValue() : 0);
             data.setMxzt(ztData != null ? (int) ztData.getDoubleValue() : 0);
             data.setDfwc(dfwcData != null ? dfwcData.getDoubleValue() : 0);
@@ -355,11 +355,11 @@ public class WindDirectionService {
 
             PowerPointData data = new PowerPointData();
             data.setTime(DateUtils.formatTimestamp(ts));
-            if (equipments.size() > 0) {
-                data.setFx(fxData.getDoubleValue() * 57.2958);
-            } else {
-                data.setFx(fxData.getDoubleValue());
-            }
+//            if (equipments.size() > 0) {
+//                data.setFx(fxData.getDoubleValue() * 57.2958);
+//            } else {
+//                data.setFx(fxData.getDoubleValue());
+//            }
             data.setSpeed(fsData != null ? fsData.getDoubleValue() : 0);
             data.setMxzt(ztData != null ? (int) ztData.getDoubleValue() : 0);
             data.setDfwc(dfwcData != null ? dfwcData.getDoubleValue() : 0);
@@ -531,7 +531,7 @@ public class WindDirectionService {
 
             listObj.forEach(obj -> {
                 int[] count = WindALG.windDeviationRatio(filterls,equipments);//风向、对风误差
-                List<Point> scatter = WindALG.windDeviationScatter(filterls,equipments);//风速、风向、对风误差
+                List<Point> scatter = WindALG.windDeviationScatter(filterls,equipments);//获取对风偏差散点——风速、风向、对风误差
                 Map<String, Object> map = new HashMap<>();
                 map.put("wtId", obj.getAname());
                 map.put("count", count);