| | |
| | | |
| | | String time = wd.getTableName().replace("su_yuan_", ""); |
| | | double lastVal = 0; |
| | | double speed1 = CalculateUtils.getWindSpeed(suYuan.getV(), suYuan.getU()); |
| | | double speed1 = CalculateUtils.round2(CalculateUtils.getWindSpeed(suYuan.getV(), suYuan.getU())); |
| | | double direction1 = CalculateUtils.getWindDirection(suYuan.getV(), suYuan.getU()); |
| | | String dir = CalculateUtils.getDir(direction1); |
| | | |
| | | double maxVal = suMax.getVocsValue(); |
| | | |
| | | double dis = CalculateUtils.getDistance2(c1.getX(), c1.getY(), c2.getX(), c2.getY()); |
| | | //double dis = CalculateUtils.getDistance2(c1.getX(), c1.getY(), c2.getX(), c2.getY()); |
| | | double dis1 = CalculateUtils.getDistance1(c1.getX(), c1.getY(), c2.getX(), c2.getY()); |
| | | double angle = CalculateUtils.getAngle(c1.getX(), c1.getY(), c2.getX(), c2.getY()); |
| | | double angle = CalculateUtils.getAngle2(c1.getX(), c1.getY(), c2.getX(), c2.getY()); |
| | | |
| | | double speed2 = CalculateUtils.getWindSpeed(suMax.getV(), suMax.getU()); |
| | | double direction2 = CalculateUtils.getWindDirection(suMax.getV(), suMax.getU()); |
| | | String maxDir = CalculateUtils.getDir(direction2); |
| | | int isSame = (Math.abs(direction1 - direction2) < 15 && Math.abs(speed1 - speed2) < 0.3) ? 1 : 0; |
| | | String maxDir = CalculateUtils.getDir(angle); |
| | | int isSame = (Math.abs(direction1 - direction2) < 30 && Math.abs(speed1 - speed2) < 0.5) ? 1 : 0; |
| | | |
| | | return new Report(wd.getLocationName(), c1.getX(), c1.getY(), wd.getValue(), lastVal, time, |
| | | speed1, dir, maxVal, dis, maxDir, isSame); |
| | | speed1, dir, maxVal, dis1, maxDir, isSame); |
| | | } |
| | | |
| | | public String getName() { |
| | |
| | | MonitorPointPosition point = commonService.select3dCheckPointByName(wd.getLocationName()); |
| | | List<String> ids3d = CalculateUtils.aloneCrosswiseExtend(point, 50); |
| | | suMax = suYuanMapper.getSuYuan500Max(wd.getTableName(), ids3d); |
| | | } else { |
| | | suMax = suYuan; |
| | | } |
| | | |
| | | Report report = Report.calcReport(wd, suYuan, suMax); |
| | |
| | | |
| | | s = s * EARTH_RADIUS1; |
| | | |
| | | return Math.round(s * 100) / 100; |
| | | return round2(s); |
| | | } |
| | | |
| | | /** |
| | |
| | | // 计算距离,单位:米 |
| | | double distance = geodeticCalculator.getOrthodromicDistance(); |
| | | |
| | | return Math.round(distance * 100) / 100; |
| | | return round2(distance); |
| | | } |
| | | |
| | | public static double round2(double d) { |
| | | return ((long)(d * 100)) / 100D; |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | double angle = gc.getAzimuth(); |
| | | |
| | | return Math.round(angle * 100) / 100; |
| | | return round2(angle); |
| | | } catch (Exception ex) { |
| | | return 0; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 计算角度2 |
| | | */ |
| | | public static double getAngle2(double x1, double y1, double x2, double y2){ |
| | | try { |
| | | DirectPosition2D p1 = new DirectPosition2D( x1, y1); |
| | | DirectPosition2D p2 = new DirectPosition2D(x2, y2); |
| | | |
| | | GeodeticCalculator gc = new GeodeticCalculator(); |
| | | gc.setStartingGeographicPoint(p1); |
| | | gc.setDestinationGeographicPoint(p2); |
| | | |
| | | double angle = gc.getAzimuth(); |
| | | |
| | | return round2(angle); |
| | | }catch (Exception ex){ |
| | | return 0; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取坐标 |
| | | * @param su |
| | | * @return |