| | |
| | | |
| | | private String solverBat; |
| | | |
| | | private String keyFrameBat; |
| | | private String sww2tifBat; |
| | | |
| | | private List<Integer> sizes; |
| | | |
| | |
| | | this.flowPath = flowPath; |
| | | } |
| | | |
| | | public String getKeyFrameBat() { |
| | | return keyFrameBat; |
| | | public String getSww2tifBat() { |
| | | return sww2tifBat; |
| | | } |
| | | |
| | | public void setKeyFrameBat(String keyFrameBat) { |
| | | this.keyFrameBat = keyFrameBat; |
| | | public void setSww2tifBat(String sww2tifBat) { |
| | | this.sww2tifBat = sww2tifBat; |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | @ApiOperation(value = "testKeyFrame *") |
| | | @GetMapping("/testKeyFrame") |
| | | public R<Object> testKeyFrame() { |
| | | @ApiOperation(value = "testSww2Tif *") |
| | | @GetMapping("/testSww2Tif") |
| | | public R<Object> testSww2Tif() { |
| | | try { |
| | | DataPo data = new DataPo(); |
| | | data.setEpsg(4548); |
| | | data.setInPath("20241010095328"); |
| | | data.setStartTime(StringHelper.YMDHMS_FORMAT.parse("2024-09-30 00:00:00")); |
| | | |
| | | Object rs = uwService.getKeyFrame(data); |
| | | Object rs = uwService.copeDrainFiles(data); |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | |
| | | //uwService.copeWaterFiles(); |
| | | |
| | | update(simu, 8, null); |
| | | uwService.copeDrainFiles(); |
| | | uwService.copeDrainFiles(data); |
| | | |
| | | update(simu, 9, null); |
| | | //resultService.process(data); |
| | | resultService.process(data); |
| | | |
| | | //update(simu, 10, "完成"); |
| | | update(simu, 10, "完成"); |
| | | } catch (Exception ex) { |
| | | log.error(ex.getMessage(), ex); |
| | | update(simu, -10, ex.getMessage()); |
| | |
| | | } |
| | | } |
| | | |
| | | public String getKeyFrame(DataPo data) throws Exception { |
| | | String cmd = config.getKeyFrameBat() + " " + config.getInPath() + File.separator + data.getInPath() + File.separator + ".save" + File.separator + data.getInPath() + ".sww"; |
| | | |
| | | String str = exec(cmd); |
| | | if (StringHelper.isEmpty(str) || !str.contains("[")) { |
| | | throw new Exception("生成关键帧出错"); |
| | | } |
| | | |
| | | String rs = str.split("\\[", 2)[1].replace("]", "").replace(" ", ""); |
| | | if (StringHelper.isEmpty(rs)) { |
| | | throw new Exception("关键帧为空"); |
| | | } |
| | | |
| | | return rs; |
| | | } |
| | | |
| | | public void copeWaterFiles() { |
| | | // |
| | | } |
| | | |
| | | public void copeDrainFiles() { |
| | | // |
| | | public String copeDrainFiles(DataPo data) throws Exception { |
| | | String time = StringHelper.YMDHMS_FORMAT.format(data.getStartTime()); |
| | | String inPath = config.getInPath() + File.separator + data.getInPath(); |
| | | String sww = inPath + File.separator + ".save" + File.separator + data.getInPath() + ".sww"; |
| | | |
| | | String cmd = config.getSww2tifBat() + " " + sww + " '" + time + "' " + data.getEpsg() + " " + inPath; |
| | | |
| | | return exec(cmd); |
| | | } |
| | | } |
| | |
| | | # 流量单位,LPS(升/秒)、CMS(立方米/秒)、CFS(立方英尺/秒) |
| | | flowUnits: CMS |
| | | solverBat: D:\simu\uwsolver\run_solver.bat |
| | | keyFrameBat: D:\simu\uwsolver\keyFrame.bat |
| | | sww2tifBat: D:\simu\uwsolver\sww2tif.bat |
| | | sizes: 64,128,256,512,1024,2048 |
| | | # 输出文件 |
| | | terrainFile: terrain.tif |