|
@@ -37,7 +37,9 @@ public class TemplateGenerator {
|
|
dataModel.put("initFilePath", BPATH+"/"+aid+"/"+jid+"/water"+"/"+"water.init");
|
|
dataModel.put("initFilePath", BPATH+"/"+aid+"/"+jid+"/water"+"/"+"water.init");
|
|
|
|
|
|
//midPath
|
|
//midPath
|
|
- dataModel.put("midPath", BPATH+"/"+aid+"/"+jid+"/water"+"/mid");
|
|
|
|
|
|
+ dataModel.put("midPath", "/home/disaster/Water/monitor.in");
|
|
|
|
+ //monitorPath
|
|
|
|
+ dataModel.put("monitorPath", BPATH+"/"+aid+"/"+jid+"/water"+"/mid");
|
|
//outPath
|
|
//outPath
|
|
dataModel.put("outPath", BPATH+"/"+aid+"/"+jid+"/water"+"/out");
|
|
dataModel.put("outPath", BPATH+"/"+aid+"/"+jid+"/water"+"/out");
|
|
dataModel.put("totaltime",totaltime);
|
|
dataModel.put("totaltime",totaltime);
|
|
@@ -46,6 +48,24 @@ public class TemplateGenerator {
|
|
dataModel.put("reportstep",reportstep);
|
|
dataModel.put("reportstep",reportstep);
|
|
dataModel.put("interactionstep",interactionstep);
|
|
dataModel.put("interactionstep",interactionstep);
|
|
|
|
|
|
|
|
+ DSourceMapper dsm =UtilTools.getBean(DSourceMapper.class);
|
|
|
|
+ DSourceSQLBuilder dss= new DSourceSQLBuilder();
|
|
|
|
+ DSourceSQLBuilder.Criteria dssc = dss.createCriteria();
|
|
|
|
+ dssc.andAidEqualTo(aid);
|
|
|
|
+// dssc.andSTypeEqualTo("Fire");
|
|
|
|
+ List<DSource> dources =dsm.selectByExample(dss);
|
|
|
|
+ //waterSourcenum 灾源数量
|
|
|
|
+ dataModel.put("waterSourcenum", dources.size());
|
|
|
|
+ //边界
|
|
|
|
+ DBoundaryMapper dBoundaryMapper = UtilTools.getBean(DBoundaryMapper.class);
|
|
|
|
+ DBoundarySQLBuilder sb =new DBoundarySQLBuilder();
|
|
|
|
+ DBoundarySQLBuilder.Criteria sc = sb.createCriteria();
|
|
|
|
+ sc.andAidEqualTo(aid);
|
|
|
|
+ List<DBoundary> boundaries = dBoundaryMapper.selectByExample(sb);
|
|
|
|
+ //边界数量
|
|
|
|
+ dataModel.put("boundarynum", boundaries.size());
|
|
|
|
+
|
|
|
|
+
|
|
// 将数据模型传入模板进行处理
|
|
// 将数据模型传入模板进行处理
|
|
StringWriter writer = new StringWriter();
|
|
StringWriter writer = new StringWriter();
|
|
template.process(dataModel, writer);
|
|
template.process(dataModel, writer);
|
|
@@ -80,13 +100,13 @@ public class TemplateGenerator {
|
|
}
|
|
}
|
|
public static void createWaterInit(Integer aid,Integer jid) throws IOException, TemplateException {
|
|
public static void createWaterInit(Integer aid,Integer jid) throws IOException, TemplateException {
|
|
FireInitVo vo =new FireInitVo();
|
|
FireInitVo vo =new FireInitVo();
|
|
-
|
|
|
|
- DNodeValMapper dnvm= UtilTools.getBean(DNodeValMapper.class);
|
|
|
|
- DNodeValSQLBuilder dns = new DNodeValSQLBuilder();
|
|
|
|
- DNodeValSQLBuilder.Criteria dnsc= dns.createCriteria();
|
|
|
|
- dnsc.andAidEqualTo(aid);
|
|
|
|
- List<DNodeVal> nodeVals=dnvm.selectByExample(dns);
|
|
|
|
- vo.setNodeVals(nodeVals);
|
|
|
|
|
|
+ //TODO 这个版本不需要传感器数据
|
|
|
|
+// DNodeValMapper dnvm= UtilTools.getBean(DNodeValMapper.class);
|
|
|
|
+// DNodeValSQLBuilder dns = new DNodeValSQLBuilder();
|
|
|
|
+// DNodeValSQLBuilder.Criteria dnsc= dns.createCriteria();
|
|
|
|
+// dnsc.andAidEqualTo(aid);
|
|
|
|
+// List<DNodeVal> nodeVals=dnvm.selectByExample(dns);
|
|
|
|
+// vo.setNodeVals(nodeVals);
|
|
|
|
|
|
DSourceMapper dsm =UtilTools.getBean(DSourceMapper.class);
|
|
DSourceMapper dsm =UtilTools.getBean(DSourceMapper.class);
|
|
DSourceSQLBuilder dss= new DSourceSQLBuilder();
|
|
DSourceSQLBuilder dss= new DSourceSQLBuilder();
|
|
@@ -159,6 +179,8 @@ public class TemplateGenerator {
|
|
//fireInteractionPath 阀门文件路径
|
|
//fireInteractionPath 阀门文件路径
|
|
dataModel.put("fireInteractionPath", "/home/disaster/fire/Fire.interaction");
|
|
dataModel.put("fireInteractionPath", "/home/disaster/fire/Fire.interaction");
|
|
//midPath
|
|
//midPath
|
|
|
|
+ dataModel.put("midPath", "/home/disaster/fire/monitor.in");
|
|
|
|
+ //midPath
|
|
dataModel.put("midPath", BPATH+"/"+aid+"/"+jid+"/fire"+"/mid");
|
|
dataModel.put("midPath", BPATH+"/"+aid+"/"+jid+"/fire"+"/mid");
|
|
//outPath
|
|
//outPath
|
|
dataModel.put("outPath", BPATH+"/"+aid+"/"+jid+"/fire"+"/out");
|
|
dataModel.put("outPath", BPATH+"/"+aid+"/"+jid+"/fire"+"/out");
|
|
@@ -186,6 +208,8 @@ public class TemplateGenerator {
|
|
//边界数量
|
|
//边界数量
|
|
dataModel.put("boundarynum", boundaries.size());
|
|
dataModel.put("boundarynum", boundaries.size());
|
|
|
|
|
|
|
|
+ //TODO 物理量
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
// 将数据模型传入模板进行处理
|
|
// 将数据模型传入模板进行处理
|
|
@@ -223,12 +247,13 @@ public class TemplateGenerator {
|
|
public static void createFireInit(Integer aid,Integer jid) throws IOException, TemplateException {
|
|
public static void createFireInit(Integer aid,Integer jid) throws IOException, TemplateException {
|
|
FireInitVo vo =new FireInitVo();
|
|
FireInitVo vo =new FireInitVo();
|
|
|
|
|
|
- DNodeValMapper dnvm= UtilTools.getBean(DNodeValMapper.class);
|
|
|
|
- DNodeValSQLBuilder dns = new DNodeValSQLBuilder();
|
|
|
|
- DNodeValSQLBuilder.Criteria dnsc= dns.createCriteria();
|
|
|
|
- dnsc.andAidEqualTo(aid);
|
|
|
|
- List<DNodeVal> nodeVals=dnvm.selectByExample(dns);
|
|
|
|
- vo.setNodeVals(nodeVals);
|
|
|
|
|
|
+ //TODO 求解器暂时不需要此数据
|
|
|
|
+// DNodeValMapper dnvm= UtilTools.getBean(DNodeValMapper.class);
|
|
|
|
+// DNodeValSQLBuilder dns = new DNodeValSQLBuilder();
|
|
|
|
+// DNodeValSQLBuilder.Criteria dnsc= dns.createCriteria();
|
|
|
|
+// dnsc.andAidEqualTo(aid);
|
|
|
|
+// List<DNodeVal> nodeVals=dnvm.selectByExample(dns);
|
|
|
|
+// vo.setNodeVals(nodeVals);
|
|
|
|
|
|
DSourceMapper dsm =UtilTools.getBean(DSourceMapper.class);
|
|
DSourceMapper dsm =UtilTools.getBean(DSourceMapper.class);
|
|
DSourceSQLBuilder dss= new DSourceSQLBuilder();
|
|
DSourceSQLBuilder dss= new DSourceSQLBuilder();
|