Parcourir la source

Merge branch 'feature-v4.9.0-20230428-dsx' into test

dsx il y a 2 ans
Parent
commit
c3a3e49361

+ 5 - 1
src/main/java/com/fdkankan/modeling/receiver/RabbitMqListener.java

@@ -12,6 +12,7 @@ import com.fdkankan.modeling.entity.BuildLog;
 import com.fdkankan.modeling.exception.BuildException;
 import com.fdkankan.modeling.handler.LaserSceneObjGenerateHandler;
 import com.fdkankan.modeling.service.IBuildLogService;
+import com.fdkankan.modeling.service.IBuildService;
 import com.fdkankan.modeling.service.ISceneBuildProcessLogService;
 import com.fdkankan.rabbitmq.bean.BuildSceneCallMessage;
 import com.fdkankan.rabbitmq.bean.BuildSceneProcessLogMessage;
@@ -78,6 +79,9 @@ public class RabbitMqListener {
     @Autowired
     private ISceneBuildProcessLogService sceneBuildProcessLogService;
 
+    @Autowired
+    private IBuildService buildService;
+
     /**
      * 场景计算
      * @param channel
@@ -240,7 +244,7 @@ public class RabbitMqListener {
          */
         this.deleteCachesAndResult(path,message);
 
-        Map<String, String> dataMap = ComputerUtil.getTypeString(cameraType, algorithm, resolution,dataJson);
+        Map<String, String> dataMap = buildService.getTypeString(cameraType, algorithm, resolution,dataJson);
 
         String splitType = dataMap.get("splitType");
         String skyboxType = dataMap.get("skyboxType");

+ 11 - 0
src/main/java/com/fdkankan/modeling/service/IBuildService.java

@@ -0,0 +1,11 @@
+package com.fdkankan.modeling.service;
+
+import com.alibaba.fastjson.JSONObject;
+
+import java.util.Map;
+
+public interface IBuildService {
+
+    Map<String, String> getTypeString(String cameraType, String algorithm, String resolution, JSONObject fdageData);
+
+}

+ 93 - 0
src/main/java/com/fdkankan/modeling/service/impl/BuildServiceImpl.java

@@ -0,0 +1,93 @@
+package com.fdkankan.modeling.service.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.fdkankan.model.enums.ModelTypeEnums;
+import com.fdkankan.modeling.service.IBuildService;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.ObjectUtils;
+import org.springframework.stereotype.Service;
+
+import java.util.HashMap;
+import java.util.Map;
+
+@Slf4j
+@Service
+public class BuildServiceImpl implements IBuildService {
+
+    @Override
+    public Map<String, String> getTypeString(String cameraType, String algorithm, String resolution, JSONObject fdageData){
+        Map<String, String> map = new HashMap<>();
+        String splitType = "";
+        String skyboxType = "";
+        String dataDescribe = "";
+        if(Integer.parseInt(cameraType) >= 4){
+            if("0".equals(resolution)){
+//            skyboxType = "SKYBOX_V4";  //tiles
+//            skyboxType = "SKYBOX_V6";    //high,low,4k
+                skyboxType = "SKYBOX_V7";    //high,low,2k
+            }else {
+                skyboxType = "SKYBOX_V1";
+            }
+            splitType = "SPLIT_V1";
+//            skyboxType = "SKYBOX_V4";  //tiles
+            dataDescribe = "double spherical";
+
+            if(Integer.parseInt(cameraType) == 5 ){
+                //新双目相机
+//              skyboxType = "SKYBOX_V9";
+                splitType = "SPLIT_V9";
+                skyboxType = "SKYBOX_V1";
+            }
+            if(Integer.parseInt(cameraType) == 6){
+                //小红屋新双目相机
+//                    skyboxType = "SKYBOX_V9";
+                splitType = "SPLIT_V3";
+                skyboxType = "SKYBOX_V7";
+            }
+
+            if(Integer.parseInt(cameraType) == 13){
+                //转台相机
+                skyboxType = "SKYBOX_V6";
+                splitType = "SPLIT_V12";
+            }
+
+            if(Integer.parseInt(cameraType) == 14){
+                //转台相机
+                log.info("激光转台相机调用算法");
+                skyboxType = "SKYBOX_V11";
+                splitType = "SPLIT_V14";
+                if (!ObjectUtils.isEmpty(fdageData)) {
+                    if ((fdageData.containsKey("exportMeshObj") && fdageData.getIntValue("exportMeshObj") == 1)
+                            || fdageData.containsKey("OnlyExportMeshObj")) {
+                        splitType = "SPLIT_V22";
+                    }
+                }
+            }
+
+        }else {
+            if("sfm".equals(algorithm)){
+                splitType = "SPLIT_V2";
+                skyboxType = "SKYBOX_V1";
+                dataDescribe = "old sfm";
+            }else {
+                splitType = "SPLIT_V3";
+                skyboxType = "SKYBOX_V1";
+                dataDescribe = "old slam";
+            }
+        }
+        if (!ObjectUtils.isEmpty(fdageData) && !ObjectUtils.isEmpty(fdageData.getString("modelType"))) {
+            switch (fdageData.getString("modelType")){
+                case ModelTypeEnums.TILE_CODE:
+                    if(skyboxType.equals("SKYBOX_V6")){
+                        skyboxType = "SKYBOX_V14";
+                    }else{
+                        skyboxType = "SKYBOX_V13";
+                    }
+            }
+        }
+        map.put("splitType", splitType);
+        map.put("skyboxType", skyboxType);
+        map.put("dataDescribe", dataDescribe);
+        return map;
+    }
+}