| | |
| | | package com.se.simu.config; |
| | | |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.boot.context.properties.ConfigurationProperties; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | |
| | | |
| | | private List<String> layerNames; |
| | | |
| | | private List<String > shpNames; |
| | | private List<String> shpNames; |
| | | |
| | | private String junctionName; |
| | | |
| | | private String junctionFilter; |
| | | |
| | | private String demName; |
| | | |
| | |
| | | |
| | | private String demFile; |
| | | |
| | | private String zoneName; |
| | | |
| | | private String barrierName; |
| | | |
| | | //@Value("#{'${config.sysFields}'}") |
| | | private List<String> sysFields; |
| | | |
| | | private String raingage; |
| | | |
| | | private String flowUnits; |
| | | |
| | | public String getVer() { |
| | | return ver; |
| | |
| | | public void setSysFields(List<String> sysFields) { |
| | | this.sysFields = sysFields; |
| | | } |
| | | |
| | | public String getJunctionName() { |
| | | return junctionName; |
| | | } |
| | | |
| | | public void setJunctionName(String junctionName) { |
| | | this.junctionName = junctionName; |
| | | } |
| | | |
| | | public String getJunctionFilter() { |
| | | return junctionFilter; |
| | | } |
| | | |
| | | public void setJunctionFilter(String junctionFilter) { |
| | | this.junctionFilter = junctionFilter; |
| | | } |
| | | |
| | | public String getZoneName() { |
| | | return zoneName; |
| | | } |
| | | |
| | | public void setZoneName(String zoneName) { |
| | | this.zoneName = zoneName; |
| | | } |
| | | |
| | | public String getRaingage() { |
| | | return raingage; |
| | | } |
| | | |
| | | public void setRaingage(String raingage) { |
| | | this.raingage = raingage; |
| | | } |
| | | |
| | | public String getFlowUnits() { |
| | | return flowUnits; |
| | | } |
| | | |
| | | public void setFlowUnits(String flowUnits) { |
| | | this.flowUnits = flowUnits; |
| | | } |
| | | |
| | | public String getBarrierName() { |
| | | return barrierName; |
| | | } |
| | | |
| | | public void setBarrierName(String barrierName) { |
| | | this.barrierName = barrierName; |
| | | } |
| | | } |
| | |
| | | package com.se.simu.domain.dto; |
| | | |
| | | import com.se.simu.config.PropertiesConfig; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Calendar; |
| | | import java.util.Date; |
| | |
| | | // 结果保存频率,相对report_step来说,比如save_step=3就表示每间隔2个report_step保存一次结果 |
| | | private Integer save_step = 1; |
| | | |
| | | public void setCalcTime(Integer minutes) { |
| | | public void setProperties(String dirName, Integer minutes, PropertiesConfig config) { |
| | | this.casedir = dirName; |
| | | this.terrain_file = config.getDemFile(); |
| | | this.studyzone_file = config.getZoneName(); |
| | | this.buildings_file = config.getShpNames().get(2); |
| | | this.nodes_file = config.getShpNames().get(0); |
| | | this.links_file = config.getShpNames().get(1); |
| | | this.junctions_file = config.getJunctionName(); |
| | | this.raingage_file = config.getRaingage(); |
| | | this.barrier_file = config.getBarrierName(); |
| | | this.drainage_outfile = dirName + ".h5"; |
| | | this.sww_outfile = dirName + ".sww"; |
| | | this.flow_units = config.getFlowUnits(); |
| | | |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(new Date()); |
| | | calendar.set(Calendar.HOUR, 0); |
| | |
| | | public static Vector<String> getOptions() { |
| | | if (null == options) { |
| | | options = new Vector<>(); |
| | | options.add("ENCODING=UTF-8"); |
| | | //options.add("ENCODING=UTF-8"); |
| | | options.add("ENCODING=GBK"); |
| | | } |
| | | |
| | | return options; |
| | |
| | | |
| | | private void createShps(String basePath, List<GeLayer> layers) throws Exception { |
| | | for (GeLayer layer : layers) { |
| | | String path = String.format("%s\\%s.shp", basePath, layer.getShpName()); |
| | | String path = basePath + File.separator + layer.getShpName(); |
| | | if (!ShpHelper.createShp(path, layer)) { |
| | | throw new Exception(layer.getName() + ",创建ShapeFile文件失败!"); |
| | | } |
| | |
| | | pwd: WUWEIWEI |
| | | dbName: 通州水利仿真 |
| | | pageSize: 2000 |
| | | layerNames: |
| | | - 管点 |
| | | - 管线 |
| | | - 建筑物 |
| | | layerNames: 管点,管线,建筑物 |
| | | shpNames: |
| | | - pipePoint |
| | | - pipeLine |
| | | - building |
| | | - pipeline-point.shp |
| | | - pipeline-conduit.shp |
| | | - buildings_inside.shp |
| | | junctionName: pipeline-point-junctions.shp |
| | | junctionFilter: jbcc=0 |
| | | demName: DEM |
| | | demType: .tif |
| | | demFile: dem.tif |
| | | sysFields: _ext_attr,_meta_id,_attach_files,_x,_y,_z,operatetime,operator,_is_latest,_data_type,groupid,id,shape_length,shape_area |
| | | demFile: DEM.tif |
| | | zoneName: studyzone.shp |
| | | barrierName: barrier.shp |
| | | sysFields: _ext_attr,_meta_id,_attach_files,_x,_y,_z,_is_latest,_data_type,operatetime,operator,groupid,id,shape_length,shape_area |
| | | raingage: RainGage.dat |
| | | # 流量单位,LPS(升/秒)、CMS(立方米/秒)、CFS(立方英尺/秒) |
| | | flowUnits: CMS |