Sfoglia il codice sorgente

mathfunc input 设置流

huangxingxing 3 mesi fa
parent
commit
50acc16ac1

+ 14 - 9
src/main/java/com/miniframe/modo/temp/TemplateGenerator.java

@@ -153,7 +153,7 @@ public class TemplateGenerator {
         MdoProFsi fsi= findFsi(pid);
         MdoProMathfunc mathfunc = findMashfunc(pid);
         //不用生成
-        if(xfoil==null&& adflow==null){
+        if(xfoil==null&& adflow==null&&mathfunc==null){
             return null;
         }
         HeaderVo header =new HeaderVo();
@@ -232,11 +232,8 @@ public class TemplateGenerator {
             pvo.setLable(uid.substring(uid.lastIndexOf("/")+1,uid.length()));
             paravos.add(pvo);
         }
-
-
-
-
-        return paravos;
+        List<ParaVo> distinctList = paravos.stream().distinct().collect(Collectors.toList());
+        return distinctList;
     }
     private static List<ParaVo> getMathFuncZdlz(String pid){
         List<ParaVo> mathfuncInPrams = new ArrayList<>();
@@ -527,9 +524,17 @@ public class TemplateGenerator {
 
         if(mathfunc!=null){
             List<MdoProInoutPara> adInoutList = findMdoProInoutParas(pid, mathfunc.getId());
-            MathfuncVo mathfuncVo =new MathfuncVo();
-            mathfuncVo.setCd_mass(getValByParaListAndCode(adInoutList,"cd_mass"));
-            vo.setMathfuncVo(mathfuncVo);
+            List<MdoProInoutPara> tList = adInoutList.stream().filter(x ->{
+                return x.getFcomid()==null;
+            }).collect(Collectors.toList());
+            List<MathfuncVo> mathfuncvos= new ArrayList<>();
+            for (MdoProInoutPara p:tList) {
+                MathfuncVo mathfuncVo =new MathfuncVo();
+                mathfuncVo.setCode(p.getCode());
+                mathfuncVo.setValue(p.getValue());
+                mathfuncvos.add(mathfuncVo);
+            }
+            vo.setMathfuncvos(mathfuncvos);
         }
 
         MdoProCst cst = findCst(pid);

+ 3 - 1
src/main/java/com/miniframe/modo/temp/cpacs/CpacsVo.java

@@ -4,6 +4,8 @@ import com.miniframe.model.mdo.*;
 import com.miniframe.modo.temp.problem.HeaderVo;
 import lombok.Data;
 
+import java.util.List;
+
 @Data
 public class CpacsVo {
     private HeaderVo header;
@@ -19,7 +21,7 @@ public class CpacsVo {
     private MdoProTacs tacs;
     private TacsOutVo tacsoutvo;
     private MdoProMathfunc mathfunc;
-    private MathfuncVo mathfuncVo;
+    private List<MathfuncVo> mathfuncvos;
     private MdoProFsi fsi;
 
 

+ 2 - 1
src/main/java/com/miniframe/modo/temp/cpacs/MathfuncVo.java

@@ -4,6 +4,7 @@ import lombok.Data;
 
 @Data
 public class MathfuncVo {
-    private String cd_mass;
+   private String code;
+   private String value;
 
 }

+ 3 - 1
src/main/resources/templates/cpacs.ftl

@@ -365,7 +365,9 @@
         <#if vo.mathfunc??>
         <mathematical>
           <mathFunc mapType="complex" uID="mathFunc1">
-            <cd_mass mapType="double">${vo.mathfuncVo.cd_mass}</cd_mass>
+            <#list vo.mathfuncvo as mfv>
+            <${mfv.code} mapType="double">${mfv.value}</${mfv.code}>
+            </#list>
           </mathFunc>
         </mathematical>
          <#else>