| | |
| | | * 调用UWSolver |
| | | */ |
| | | public String callUwSolver(Simu simu, SimuData data) throws Exception { |
| | | File uwBat = new File(config.getUwSolverBat()); |
| | | |
| | | int duration = 3600 * data.getDuration(); // 秒数 |
| | | if (null != data.getRainfalls() && data.getRainfalls().size() > 1) { |
| | | List<Rainfall> rainfalls = data.getRainfalls(); |
| | |
| | | } |
| | | |
| | | private List<Double> getValues(String csvPath) throws Exception { |
| | | if (!new File(csvPath).exists()) return null; |
| | | if (!new File(csvPath).exists()) return Collections.emptyList(); |
| | | |
| | | List<String> list = Files.readAllLines(Paths.get(csvPath)); |
| | | list.remove(0); |
| | | //list.remove(list.size() - 1); |
| | | |
| | | return list.stream() |
| | | .map(s -> new BigDecimal(s).setScale(6, RoundingMode.HALF_DOWN).doubleValue()) |
| | |
| | | File dem = new File(serviceNameDir, "DEM.tif"); |
| | | resultDto.setTerrainFile(dem.getAbsolutePath()); |
| | | File newDepthDir = new File(serviceNameDir + File.separator + "depth_" + currentTime); |
| | | File[] files = newDepthDir.listFiles(); |
| | | resultDto.setWaterPath(newDepthDir.getAbsolutePath()); |
| | | LayerDto layerDto = new LayerDto(config.getVer(), 4548, config.getSizes()); |
| | | String newLayerJsonName = "layer_" + currentTime + ".json"; |