| | |
| | | package com.se.nsl.domain.vo; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | @SuppressWarnings("ALL") |
| | | public class ConfigVo { |
| | | private List<Object> terrain; |
| | | private String terrain; |
| | | |
| | | private List<Object> landuse; |
| | | private String landuse; |
| | | |
| | | private List<Object> station; |
| | | private int station; |
| | | |
| | | private Integer kSt; |
| | | |
| | |
| | | |
| | | private Integer initial_ymomentum; |
| | | |
| | | private String raingage; |
| | | private List<String> raingage; |
| | | |
| | | private String infiltration; |
| | | |
| | |
| | | private ResultVo result; |
| | | |
| | | public ConfigVo() { |
| | | this.terrain = new ArrayList<Object>(Arrays.asList("case1/LiuLiMiaoZhen_5m_f32.tif", 1)); |
| | | // this.terrain = new ArrayList<Object>(Arrays.asList("case1/LiuLiMiaoZhen_5m_f32.tif")); |
| | | // 1-Cropland,2-Forest,3-Shrub,4-Grassland,5-Water,6-Snow/Ice,7-Barren,8-Impervious,9-Wetland |
| | | this.landuse = new ArrayList<Object>(Arrays.asList("case1/LiuLiMiaoZhen_5m_landuse_grassland.tif", 1)); |
| | | this.station = new ArrayList<Object>(Arrays.asList("case1/LiuLiMiaoZhen_5m_station.tif", 1)); |
| | | |
| | | // this.landuse = new ArrayList<Object>(Arrays.asList("case1/LiuLiMiaoZhen_5m_landuse_grassland.tif")); |
| | | // this.station = new ArrayList<Object>(Arrays.asList("case1/LiuLiMiaoZhen_5m_station.tif", 1)); |
| | | this.station = 0; |
| | | this.kSt = 40; |
| | | this.initial_depth = 0; |
| | | this.initial_xmomentum = 0; |
| | |
| | | public ConfigVo(String terrain, String landuse, String station, String raingage, String saveName, int duration, int frames) { |
| | | this(); |
| | | |
| | | this.terrain.set(0, terrain.replace("\\", "/")); // 地形高程数据 |
| | | this.landuse.set(0, landuse.replace("\\", "/")); // 土地利用类型 |
| | | this.station.set(0, station.replace("\\", "/")); // 雨量站索引 |
| | | this.raingage = raingage.replace("\\", "/"); |
| | | // this.terrain.set(0, terrain.replace("\\", "/")); // 地形高程数据 |
| | | // this.landuse.set(0, landuse.replace("\\", "/")); // 土地利用类型 |
| | | // this.station.set(0, station.replace("\\", "/")); // 雨量站索引 |
| | | // this.raingage = raingage.replace("\\", "/"); |
| | | this.terrain = terrain; |
| | | this.landuse = landuse; |
| | | this.raingage = Arrays.asList(raingage, "mm/min"); |
| | | this.duration = duration; |
| | | |
| | | int saveInterval = duration / frames - 5; // 修订最后一帧可能为空数据 |
| | | this.result = new ResultVo(saveName, frames, saveInterval); |
| | | } |
| | | |
| | | public List<Object> getTerrain() { |
| | | public String getTerrain() { |
| | | return terrain; |
| | | } |
| | | |
| | | public void setTerrain(List<Object> terrain) { |
| | | public void setTerrain(String terrain) { |
| | | this.terrain = terrain; |
| | | } |
| | | |
| | | public List<Object> getLanduse() { |
| | | public String getLanduse() { |
| | | return landuse; |
| | | } |
| | | |
| | | public void setLanduse(List<Object> landuse) { |
| | | public void setLanduse(String landuse) { |
| | | this.landuse = landuse; |
| | | } |
| | | |
| | | public List<Object> getStation() { |
| | | public int getStation() { |
| | | return station; |
| | | } |
| | | |
| | | public void setStation(List<Object> station) { |
| | | public void setStation(int station) { |
| | | this.station = station; |
| | | } |
| | | |
| | |
| | | this.initial_ymomentum = initial_ymomentum; |
| | | } |
| | | |
| | | public String getRaingage() { |
| | | public List<String> getRaingage() { |
| | | return raingage; |
| | | } |
| | | |
| | | public void setRaingage(String raingage) { |
| | | public void setRaingage(List<String> raingage) { |
| | | this.raingage = raingage; |
| | | } |
| | | |
| | |
| | | createNsl(data); |
| | | |
| | | update(simu, 10, "完成"); |
| | | log.info("模拟完成"); |
| | | } catch (Exception ex) { |
| | | log.error(ex.getMessage(), ex); |
| | | update(simu, 20, ex.getMessage()); |
| | |
| | | } |
| | | //list.add(prefix + YYYYMDHM.format(rainfalls.get(c).getTime()) + getMinVal(rainfalls.get(c).getIntensity() / unit, DIGIT)); |
| | | list.add(String.format("%s%s%f", prefix, YYYYMDHM.format(rainfalls.get(c).getTime()), getMinVal(rainfalls.get(c).getIntensity() / unit, DIGIT))); |
| | | list.add(0, "1 " + (list.size() - 1)); |
| | | // list.add(0, "1 " + (list.size() - 1)); |
| | | |
| | | Files.write(Paths.get(rainfallFile), list, StandardCharsets.UTF_8); |
| | | } |
| | |
| | | try (BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream(), "GBK"))) { |
| | | String line; |
| | | while ((line = reader.readLine()) != null) { |
| | | System.out.println(line); |
| | | // System.out.println(line); |
| | | //sb.append(line); |
| | | log.info(line); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | cal.add(Calendar.MINUTE, 1); |
| | | } |
| | | list.add(0, "1 " + (list.size() - 1)); |
| | | // list.add(0, "1 " + (list.size() - 1)); |
| | | |
| | | Files.write(Paths.get(dat), list, StandardCharsets.UTF_8); |
| | | } |
| | |
| | | flowUnits: CMS |
| | | solverBat: D:\other\simu\uwsolver\run_solver.bat |
| | | sww2tifBat: D:\other\simu\uwsolver\sww2tif.bat |
| | | uwSolverBat: D:\other\simu\CudaUWSolver-2.0\start.bat |
| | | # uwSolverBat: D:\other\simu\CudaUWSolver.Demo.NoVis.20250430\start.bat |
| | | uwSolverBat: D:\other\simu\CudaUWSolver-2.1.1\cuws.bat |
| | | # uwSolverBat: D:\other\simu\CudaUWSolver-2.0\start.bat |
| | | zarr2tifBat: D:\other\simu\zarr2tif-2.1\start.bat |
| | | # zarr2tifBat: D:\other\simu\zarr2tif1.0\start.bat |
| | | # zarr2tifBat: D:\other\simu\zarr2tif-2.0-mkl\start.bat |
| | | createRainfall: '"C:\Program Files\Python310\python.exe" D:\terrait\NslServer\data\CreatRainfall.py' |
| | | rainfallTitle: Station Longitude Latitude Year Month Day Hour Minute Intensity |
| | | rainfallSite: beijing |
| | | epsg: 4548 |
| | | saveFrames: 3 |
| | | # saveFrames: 3 |
| | | #生成帧数的间隔时间,单位是分钟,设置为5表示每隔5分钟生成一帧 |
| | | saveFrameInterval: 5 |
| | | saveFrameInterval: 10 |
| | | # 土地利用:1-Cropland,2-Forest,3-Shrub,4-Grassland,5-Water,6-Snow/Ice,7-Barren,8-Impervious,9-Wetland |
| | | landuse: 2 |
| | | #sizes: 64,128,256,512,1024,2048,4096 |
| | |
| | | waterPath: depth |
| | | flowPath: velocity |
| | | landuseFile: Landuse.tif |
| | | sourceDem: D:\other\simu\CudaUWSolver-2.0\Beijing-Data-10m\Beijing-4548-ASTERDEMV3-10m.tif |
| | | sourceLanduse: D:\other\simu\CudaUWSolver-2.0\Beijing-Data-10m\Beijing-4548-Landuse-10m-Nonodata.tif |
| | | sourceDem: D:\other\simu\CudaUWSolver-2.1.1\Beijing-Data-10m\Beijing-4548-ASTERDEMV3-10m.tif |
| | | sourceLanduse: D:\other\simu\CudaUWSolver-2.1.1\Beijing-Data-10m\Beijing-4548-Landuse-10m-Nonodata.tif |
| | | copyTif: false |
| | | tifPath: D:\other\simu\uwsolver\5ca43c87cd8e48c5a9c5399a5da46dbc\tongzhou_raster_4548_1m_clip_river_fill.tif |
| | | #tif中的高程文件名要含有dem,土地利用要含有landuse,站点要含有station,不限制大小写,文字尽量用英文字母表达 |
| | | keyDitch: D:\other\simu\CudaUWSolver-2.0\KeyDitch |
| | | keyDitch: D:\other\simu\CudaUWSolver-2.1.1\KeyDitch |
| | | |