|
@@ -20,10 +20,12 @@ import com.miniframe.generate.business.system.model.AFT001BaseModel;
|
|
import com.miniframe.model.system.*;
|
|
import com.miniframe.model.system.*;
|
|
import com.miniframe.model.system.dao.*;
|
|
import com.miniframe.model.system.dao.*;
|
|
import com.miniframe.service.mq.CaeMQ;
|
|
import com.miniframe.service.mq.CaeMQ;
|
|
|
|
+import com.miniframe.solverconfig.fem.FEMPath;
|
|
import com.miniframe.solverconfig.hcfd.HcfdPath;
|
|
import com.miniframe.solverconfig.hcfd.HcfdPath;
|
|
import com.miniframe.spring.mq.MFMqUtils;
|
|
import com.miniframe.spring.mq.MFMqUtils;
|
|
import com.miniframe.tools.XIFileUtils;
|
|
import com.miniframe.tools.XIFileUtils;
|
|
import com.miniframe.tools.XiJsonUtil;
|
|
import com.miniframe.tools.XiJsonUtil;
|
|
|
|
+import org.json.JSONArray;
|
|
import org.json.JSONObject;
|
|
import org.json.JSONObject;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -303,11 +305,144 @@ public class AFT001Service extends AFT001BaseModel implements ExecProcessFlow {
|
|
throw new BusinessException("EB4000014");
|
|
throw new BusinessException("EB4000014");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ }else if(action.equals("animation")){
|
|
|
|
+ JSONObject obj = new JSONObject();
|
|
|
|
+ animationTypePara(scalarName, level, range0, range1, obj);
|
|
|
|
+ if(solver.getSolverModel().equals("HCFDLab")) {
|
|
|
|
+ animationHcfdFile(proId, obj);
|
|
|
|
+ }else if(solver.getSolverModel().equals("FEMLab(结构力学)")){
|
|
|
|
+ animationFemFile(proId, obj);
|
|
|
|
+ }
|
|
|
|
+ msg.setParamJson(obj.toString());
|
|
}
|
|
}
|
|
-
|
|
|
|
MFMqUtils.get(CaeMQ.class).sendCaein(XiJsonUtil.objectToJson(msg));
|
|
MFMqUtils.get(CaeMQ.class).sendCaein(XiJsonUtil.objectToJson(msg));
|
|
|
|
|
|
}
|
|
}
|
|
|
|
+ /**
|
|
|
|
+ * FEM 动画文件获取
|
|
|
|
+ * @param proId
|
|
|
|
+ * @param obj
|
|
|
|
+ * @throws BusinessException
|
|
|
|
+ */
|
|
|
|
+ private void animationFemFile(String proId, JSONObject obj) throws BusinessException {
|
|
|
|
+ String jobPath = XIFileUtils.getRootPathStr()+ MFConstant.separator+ proId;
|
|
|
|
+ String exePath = jobPath+ MFConstant.separator+"fem";
|
|
|
|
+ String exeOutPath = exePath+ MFConstant.separator+"data_out";
|
|
|
|
+ JSONArray jsonArray = new JSONArray();
|
|
|
|
+ List<Integer> steps = FEMPath.femTeps(proId);
|
|
|
|
+ for (Integer st:steps) {
|
|
|
|
+ List<File> fileList = FEMPath.getStepFiles(proId,st.toString());
|
|
|
|
+ String fileName="";
|
|
|
|
+ for (int i = 0; i < fileList.size(); i++) {
|
|
|
|
+ if(i==fileList.size()-1){
|
|
|
|
+ fileName +=fileList.get(i).getName();
|
|
|
|
+ }else {
|
|
|
|
+ fileName +=fileList.get(i).getName()+",";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ JSONObject obj2 = new JSONObject();
|
|
|
|
+ obj2.put("step",st);
|
|
|
|
+ obj2.put("fileName",fileName);
|
|
|
|
+ jsonArray.put(obj2);
|
|
|
|
+ }
|
|
|
|
+ obj.put("filePath", exeOutPath);
|
|
|
|
+ obj.put("fileType", "ascii");
|
|
|
|
+ obj.put("fileName", jsonArray);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 根据渲染类型 设置参数
|
|
|
|
+ * @param scalarName
|
|
|
|
+ * @param level
|
|
|
|
+ * @param range0
|
|
|
|
+ * @param range1
|
|
|
|
+ * @param obj
|
|
|
|
+ * @throws BusinessException
|
|
|
|
+ */
|
|
|
|
+ private void animationTypePara(String scalarName, String level, String range0, String range1, JSONObject obj) throws BusinessException {
|
|
|
|
+ String animationType = getA_aft001().getAnimationType();
|
|
|
|
+ if(StringUtil.isNullOrEmpty(animationType)){
|
|
|
|
+ throw new BusinessException("4000018");
|
|
|
|
+ }else if(animationType.equals("ContourDisplay")){
|
|
|
|
+ obj.put("level", level);
|
|
|
|
+ obj.put("range", range0 +","+ range1);
|
|
|
|
+ obj.put("scalarName", scalarName);
|
|
|
|
+ }else if(animationType.equals("LineDisplay")){
|
|
|
|
+ obj.put("level", level);
|
|
|
|
+ obj.put("range", range0 +","+ range1);
|
|
|
|
+ obj.put("scalarName", scalarName);
|
|
|
|
+ }else if(animationType.equals("VectorDisplay")){
|
|
|
|
+ if(this.getA_aft001().getScaleFactor()==null
|
|
|
|
+ ||"".equals(this.getA_aft001().getScaleFactor())||
|
|
|
|
+ this.getA_aft001().getDataU()==null
|
|
|
|
+ ||"".equals(this.getA_aft001().getDataU())||
|
|
|
|
+ this.getA_aft001().getDataV()==null
|
|
|
|
+ ||"".equals(this.getA_aft001().getDataV())||
|
|
|
|
+ this.getA_aft001().getDataW()==null
|
|
|
|
+ ||"".equals(this.getA_aft001().getDataW())
|
|
|
|
+ ){
|
|
|
|
+ throw new BusinessException("EB4000013");
|
|
|
|
+ }
|
|
|
|
+ obj.put("scaleFactor",this.getA_aft001().getScaleFactor());
|
|
|
|
+ obj.put("dataU",this.getA_aft001().getDataU());
|
|
|
|
+ obj.put("dataV",this.getA_aft001().getDataV());
|
|
|
|
+ obj.put("dataW",this.getA_aft001().getDataW());
|
|
|
|
+ }else if(animationType.equals("SolidSurfaceDisplay")){
|
|
|
|
+ String r =this.getA_aft001().getR();
|
|
|
|
+ String g =this.getA_aft001().getG();
|
|
|
|
+ String b =this.getA_aft001().getB();
|
|
|
|
+ String transparency=this.getA_aft001().getTransparency();
|
|
|
|
+ String showHideState=this.getA_aft001().getShowHideState();
|
|
|
|
+ if(r==null || "".equals(r)
|
|
|
|
+ ||g==null || "".equals(g)
|
|
|
|
+ ||b==null || "".equals(b)
|
|
|
|
+ ||transparency==null || "".equals(transparency)
|
|
|
|
+ ||showHideState==null || "".equals(showHideState)
|
|
|
|
+
|
|
|
|
+ ){
|
|
|
|
+
|
|
|
|
+ throw new BusinessException("EB4000013");
|
|
|
|
+ }
|
|
|
|
+ obj.put("r",r);
|
|
|
|
+ obj.put("g",g);
|
|
|
|
+ obj.put("b",b);
|
|
|
|
+ obj.put("transparency",transparency);
|
|
|
|
+ obj.put("showHideState","1".equals(showHideState)?true:false);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Hcfd 动画文件获取
|
|
|
|
+ * @param proId
|
|
|
|
+ * @param obj
|
|
|
|
+ * @throws BusinessException
|
|
|
|
+ */
|
|
|
|
+ private void animationHcfdFile(String proId, JSONObject obj) throws BusinessException {
|
|
|
|
+ String jobPath = XIFileUtils.getRootPathStr()+ MFConstant.separator+ proId;
|
|
|
|
+ String exePath = jobPath+ MFConstant.separator+"hcfd";
|
|
|
|
+ String testPath = exePath+ MFConstant.separator+"test";
|
|
|
|
+ String exeOutPath = testPath+ MFConstant.separator+"data_out";
|
|
|
|
+ JSONArray jsonArray = new JSONArray();
|
|
|
|
+ List<Integer> steps =HcfdPath.hcfdTeps(proId);
|
|
|
|
+ for (Integer st:steps) {
|
|
|
|
+ List<File> fileList = HcfdPath.getStepFiles(proId, getA_aft001().getIsVolume(), st.toString());
|
|
|
|
+ String fileName="";
|
|
|
|
+ for (int i = 0; i < fileList.size(); i++) {
|
|
|
|
+ if(i==fileList.size()-1){
|
|
|
|
+ fileName +=fileList.get(i).getName();
|
|
|
|
+ }else {
|
|
|
|
+ fileName +=fileList.get(i).getName()+",";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ JSONObject obj2 = new JSONObject();
|
|
|
|
+ obj2.put("step",st);
|
|
|
|
+ obj2.put("fileName",fileName);
|
|
|
|
+ jsonArray.put(obj2);
|
|
|
|
+ }
|
|
|
|
+ obj.put("filePath", exeOutPath);
|
|
|
|
+ obj.put("fileType", "ascii");
|
|
|
|
+ obj.put("fileNames", jsonArray);
|
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
/**
|
|
* 基础系统,“后处理消息发送”业务前处理
|
|
* 基础系统,“后处理消息发送”业务前处理
|