| | |
| | | package com.se.simu.service; |
| | | |
| | | import cn.hutool.json.JSONUtil; |
| | | import com.mathworks.toolbox.javabuilder.MWCharArray; |
| | | import com.se.simu.config.PropertiesConfig; |
| | | import com.se.simu.domain.dto.ConfigDto; |
| | | import com.se.simu.domain.po.DataPo; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.*; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 内涝求解器服务类 |
| | |
| | | try { |
| | | // new String[] { "/bin/sh", "-c", cmd } |
| | | process = Runtime.getRuntime().exec(cmd); |
| | | nr = new BufferedReader(new InputStreamReader(process.getInputStream())); |
| | | er = new BufferedReader(new InputStreamReader(process.getErrorStream())); |
| | | nr = new BufferedReader(new InputStreamReader(process.getInputStream(), "GBK")); |
| | | er = new BufferedReader(new InputStreamReader(process.getErrorStream(), "GBK")); |
| | | |
| | | String errorLine; |
| | | while ((errorLine = er.readLine()) != null) { |
| | |
| | | // |
| | | } |
| | | |
| | | 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); |
| | | } |
| | | } |