Explorar el Código

obj计算 算法入参变更

dsx hace 2 años
padre
commit
ab1fa1063b

+ 6 - 0
pom.xml

@@ -89,6 +89,12 @@
 		</dependency>
 
 		<dependency>
+			<groupId>com.alibaba.cloud</groupId>
+			<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
+			<version>2.2.7.RELEASE</version>
+		</dependency>
+
+		<dependency>
 			<groupId>org.projectlombok</groupId>
 			<artifactId>lombok</artifactId>
 		</dependency>

+ 2 - 0
src/main/java/com/fdkankan/modeling/ModelingApplication.java

@@ -3,6 +3,7 @@ package com.fdkankan.modeling;
 import org.mybatis.spring.annotation.MapperScan;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
 import org.springframework.context.annotation.ComponentScan;
 import org.springframework.scheduling.annotation.EnableScheduling;
 
@@ -10,6 +11,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
 @EnableScheduling
 @ComponentScan(basePackages = {"com.fdkankan.*"})
 @MapperScan("com.fdkankan.**.mapper")
+@EnableDiscoveryClient
 public class ModelingApplication {
 
 	public static void main(String[] args) {

+ 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);
+
+}

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

@@ -0,0 +1,95 @@
+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)) {
+                        splitType = "SPLIT_V22";
+                    }
+                    if(fdageData.containsKey("OnlyExportMeshObj")){
+                        splitType = "SPLIT_V20";
+                    }
+                }
+            }
+
+        }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;
+    }
+}