1
13693261870
2024-10-09 fc98146d74aad6caf4ab95a5932b5a8a355a94a3
1
已修改4个文件
70 ■■■■■ 文件已修改
src/main/java/com/se/simu/config/PropertiesConfig.java 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/se/simu/service/ResultService.java 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/se/simu/service/SimuService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/application.yml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/se/simu/config/PropertiesConfig.java
@@ -64,6 +64,14 @@
    private List<Integer> sizes;
    private String terrainFile;
    private String buildingFile;
    private String waterPath;
    private String flowPath;
    public String getVer() {
        return ver;
    }
@@ -255,4 +263,36 @@
    public void setSizes(List<Integer> sizes) {
        this.sizes = sizes;
    }
    public String getTerrainFile() {
        return terrainFile;
    }
    public void setTerrainFile(String terrainFile) {
        this.terrainFile = terrainFile;
    }
    public String getBuildingFile() {
        return buildingFile;
    }
    public void setBuildingFile(String buildingFile) {
        this.buildingFile = buildingFile;
    }
    public String getWaterPath() {
        return waterPath;
    }
    public void setWaterPath(String waterPath) {
        this.waterPath = waterPath;
    }
    public String getFlowPath() {
        return flowPath;
    }
    public void setFlowPath(String flowPath) {
        this.flowPath = flowPath;
    }
}
src/main/java/com/se/simu/service/ResultService.java
@@ -6,6 +6,7 @@
import com.se.simu.domain.dto.ExtensionDto;
import com.se.simu.domain.dto.LayerDto;
import com.se.simu.domain.dto.ResultDto;
import com.se.simu.domain.po.DataPo;
import com.se.simu.helper.GdalHelper;
import lombok.extern.slf4j.Slf4j;
import org.gdal.gdal.Band;
@@ -48,14 +49,28 @@
                "D:\\simu\\input\\flows",
                "D:\\simu\\out",
                "");
        process(dto);
        LayerDto layer = new LayerDto(config.getVer(), 4528, config.getSizes());
        process(dto, layer);
        return "OK";
    }
    public void process(ResultDto dto) throws Exception {
    public void process(DataPo data) throws Exception {
        String basePath = config.getInPath() + File.separator + data.getInPath() + File.separator;
        ResultDto dto = new ResultDto(
                data.getInPath(),
                basePath + config.getTerrainFile(),
                basePath + config.getBuildingFile(),
                basePath + config.getWaterPath(),
                basePath + config.getFlowPath(),
                config.getOutPath(),
                "");
        LayerDto layer = new LayerDto(config.getVer(), data.getEpsg(), config.getSizes());
        process(dto, layer);
    }
    private void process(ResultDto dto, LayerDto layer) throws Exception {
        try {
            LayerDto layer = new LayerDto(config.getVer(), 4528, config.getSizes());
            copeTerrain(dto, layer);
            copeBuilding(dto, layer);
src/main/java/com/se/simu/service/SimuService.java
@@ -210,9 +210,9 @@
            uwService.copeDrainFiles();
            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());
src/main/resources/application.yml
@@ -123,3 +123,8 @@
  flowUnits: CMS
  solverBat: D:\simu\uwsolver\run_solver.bat
  sizes: 64,128,256,512,1024,2048
  # 输出文件
  terrainFile: terrain.tif
  buildingFile: buildings.tif
  waterPath: waters
  flowPath: flows