xingjinshuang
2025-02-20 0890b7861feae74bdcfd1851e577db6b9f31d484
src/main/java/com/se/simu/service/UwService.java
@@ -13,12 +13,6 @@
import javax.annotation.Resource;
import java.io.*;
/**
 * 内涝求解器服务类
 *
 * @author WWW
 * @date   2024-09-29
 */
@Slf4j
@Service
@SuppressWarnings("ALL")
@@ -36,12 +30,6 @@
        return _rainfall;
    }
    /**
     * 创建降雨文件
     * <p>
     * https://blog.csdn.net/Dark_Drgon/article/details/139739924
     * C:\Program Files\matlab\R2020a\runtime\win64
     */
    public void createRainFile(DataPo data) throws Exception {
        String filePath = config.getInPath() + File.separator + data.getInPath() + File.separator + config.getRaingage();
        String startTime = StringHelper.YMDHMS_FORMAT.format(data.getStartTime());
@@ -105,7 +93,6 @@
                log.error(errorLine);
            }
            // 等待程序执行结束并输出状态
            int exitCode = process.waitFor();
            return sb.toString();
@@ -138,14 +125,6 @@
        }
    }
    /**
     * 执行命令行,并等待命令执行完毕
     *
     * https://www.cnblogs.com/stars-one/p/16482964.html
     * @param cmd 命令,window记得要使用cmd /c开头,如cmd /c ipconfig
     * @throws IOException
     * @throws InterruptedException
     */
    private String execCmdLine(String cmd) throws IOException, InterruptedException {
        Process process = Runtime.getRuntime().exec(cmd);
@@ -216,4 +195,13 @@
        return exec(cmd);
    }
    public String copeSwwDrainFiles(DataPo data) throws Exception {
        String time = StringHelper.YMDHMS_FORMAT.format(data.getStartTime());
        String inPath = "H:\\simu\\semout";
        String sww = "H:\\simu\\semout\\testsem\\.out\\" + "testsem.sww";
        String cmd = config.getSww2tifBat() + " " + sww + " \"" + time + "\" " + data.getEpsg() + " " + inPath;
        return exec(cmd);
    }
}