Kaynağa Gözat

四维深巡

dengsixing 4 ay önce
ebeveyn
işleme
aba4968735

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

@@ -20,6 +20,8 @@ import org.springframework.scheduling.annotation.EnableScheduling;
 
 import java.util.List;
 
+import javax.annotation.Resource;
+
 @SpringBootApplication
 @EnableScheduling
 @ComponentScan(basePackages = {"com.fdkankan.*"})

+ 0 - 12
src/main/java/com/fdkankan/modeling/handler/LaserSceneObjGenerateHandler.java

@@ -19,18 +19,6 @@ public class LaserSceneObjGenerateHandler implements SceneHandler {
     public void handle(Map<String, String> context) throws Exception {
         try {
             String laserObjFilePath = context.get("path");
-            String cameraType = context.get("cameraType");
-            String algorithm = context.get("algorithm");
-            String resolution = context.get("resolution");
-            JSONObject fdageData = JSONObject.parseObject(context.get("dataJson"));
-            String projectNum = context.get("projectNum");
-
-            Map<String, String> dataMap = ComputerUtil.getTypeString(cameraType, algorithm, resolution, fdageData);
-            Map<String, Object> dataExtras = new HashMap<>(1);
-            dataExtras.put("big_depthmap", true);
-            ComputerUtil.createProjectAndDataFile(laserObjFilePath, projectNum, dataMap.get("splitType"),
-                    dataMap.get("skyboxType"), null, dataExtras);
-
             //计算模型并返回需要上传oss的文件集合
             CreateObjUtil.build3dModel(laserObjFilePath, "");
 

+ 4 - 59
src/main/java/com/fdkankan/modeling/receiver/RabbitMqListener.java

@@ -99,7 +99,6 @@ public class RabbitMqListener {
      * @throws Exception
      */
     @RabbitListener(
-            //queuesToDeclare = @Queue("${queue.modeling.modeling-call}"),
             queuesToDeclare = @Queue("#{queueNameService.getQueueName()}"),
             concurrency = "${maxThread.modeling.modeling-call}",
             priority = "${mq.consumerPriority}"
@@ -170,8 +169,6 @@ public class RabbitMqListener {
         StopWatch watch = new StopWatch();
         watch.start();
 
-        String num = message.getSceneNum();
-
         //发送记录计算状态为计算中
         this.sendCallBuildProcessLog(message, ModelingBuildStatus.CALCULATING);
 
@@ -233,65 +230,17 @@ public class RabbitMqListener {
         String num = message.getSceneNum();
         //不同的相机不同的方法
         String cameraType = message.getCameraType();
-        String algorithm = message.getAlgorithm();
-        //0表示有4k图,1表示没有
-        String resolution = message.getResolution();
         //判断调用V2还是V3版本的算法
         String buildType = ObjectUtils.isEmpty(message.getBuildType()) ? "V2" : message.getBuildType();
+        if(StrUtil.isEmpty(buildType)){
+            buildType = "V3";
+        }
 
         buildSceneResult.setCameraType(cameraType);
         buildSceneResult.setNum(num);
         buildSceneResult.setPath(path);
 
-        log.info("用的算法是:" + algorithm);
-
-        String dataFdagePath = path + File.separator + "capture" +File.separator+"data.fdage";
-        log.info("dataFdagePath 文件路径 :{}", dataFdagePath);
-        String data = FileUtils.readFile(dataFdagePath);
-        //获取data.fdage的内容
-        JSONObject dataJson = new JSONObject();
-        if(data!=null){
-            dataJson = JSONObject.parseObject(data);
-        }
-
-        if (dataJson.containsKey("OnlyExportMeshObj")) {
-            logRecord.setBuildType(2);
-            Map<String, String> context = new HashMap<>();
-            context.put("path", path);
-            context.put("cameraType", cameraType);
-            context.put("algorithm", algorithm);
-            context.put("resolution", resolution);
-            context.put("projectNum", num);
-            context.put("dataJson", data);
-            try {
-                laserSceneObjGenerateHandler.handle(context);
-            } catch (Exception e) {
-                e.printStackTrace();
-            }
-
-            // 检测计算结果文件是否有生成
-            String resultsPath = path + File.separator + "results" + File.separator;
-            if (!new File(resultsPath + "upload.json").exists()) {
-                log.error("未检测到计算结果文件:upload.json");
-                return ModelingBuildStatus.FAILED;
-            }
-
-            return ModelingBuildStatus.SUCCESS;
-        }
-
-        Map<String, String> dataMap = buildService.getTypeString(cameraType, algorithm, resolution,dataJson);
-
-        String splitType = dataMap.get("splitType");
-        String skyboxType = dataMap.get("skyboxType");
-        if(Objects.nonNull(message.getExt().get("splitType"))){
-            splitType = (String) message.getExt().get("splitType");
-        }
-        if(Objects.nonNull(message.getExt().get("skyboxType"))){
-            skyboxType = (String) message.getExt().get("skyboxType");
-        }
-
-        ComputerUtil.createProjectAndDataFile(path,num, splitType, skyboxType,null,null);
-        //计算模型并返回需要上传oss的文件集合
+        //调用算法
         ComputerUtil.computer(num, path, buildType);
 
         // 检测计算结果文件是否有生成
@@ -317,10 +266,6 @@ public class RabbitMqListener {
         buildSceneResult.setNum(num);
         buildSceneResult.setPath(path);
 
-        String splitType = "SPLIT_V27";
-        String skyboxType = "SKYBOX_V5";
-
-        ComputerUtil.createProjectAndDataFile(path,num, splitType, skyboxType,null,null);
         //计算模型并返回需要上传oss的文件集合
         ComputerUtil.computer(num, path, "V3");
 

+ 1 - 6
src/main/java/com/fdkankan/modeling/service/impl/BuildServiceImpl.java

@@ -20,7 +20,6 @@ public class BuildServiceImpl implements IBuildService {
         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
@@ -31,9 +30,8 @@ public class BuildServiceImpl implements IBuildService {
             }
             splitType = "SPLIT_V1";
 //            skyboxType = "SKYBOX_V4";  //tiles
-            dataDescribe = "double spherical";
 
-            if(Integer.parseInt(cameraType) == 5 ){
+            if(Integer.parseInt(cameraType) == 5){
                 //新双目相机
 //              skyboxType = "SKYBOX_V9";
                 splitType = "SPLIT_V9";
@@ -76,11 +74,9 @@ public class BuildServiceImpl implements IBuildService {
             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"))) {
@@ -101,7 +97,6 @@ public class BuildServiceImpl implements IBuildService {
         }
         map.put("splitType", splitType);
         map.put("skyboxType", skyboxType);
-        map.put("dataDescribe", dataDescribe);
         return map;
     }
 }

+ 0 - 32
src/main/java/com/fdkankan/modeling/service/impl/ReverseE57ServiceImpl.java

@@ -173,18 +173,6 @@ public class ReverseE57ServiceImpl implements IReverseE57Service {
         buildSceneResult.setNum(num);
         buildSceneResult.setPath(path);
 
-        String splitType = "SPLIT_V29";
-        String skyboxType = "SKYBOX_V11";
-        String otherType = (String)message.getExt().get("otherType");
-        Integer isObj = (Integer) message.getExt().get("isObj");
-        if(StrUtil.isNotEmpty(modelType) && ModelTypeEnums.TILE_CODE.equals(modelType)){
-            skyboxType = "SKYBOX_V15";
-        }
-        if(Objects.nonNull(isObj) && isObj == CommonStatus.YES.code().intValue()){
-            splitType = "SPLIT_V30";
-        }
-
-        this.createProjectAndDataFile(path,num, splitType, skyboxType,otherType,null,null);
         //计算模型并返回需要上传oss的文件集合
         ComputerUtil.computer(num, path, buildType);
 
@@ -199,25 +187,5 @@ public class ReverseE57ServiceImpl implements IReverseE57Service {
         return ModelingBuildStatus.SUCCESS;
     }
 
-    public void createProjectAndDataFile(String path, String sceneNum, String splitType, String skyboxType, String otherType, Map<String, Object> projectExtras, Map<String, Object> dataExtras) {
-        JSONObject projectJson = new JSONObject();
-        if (!org.apache.commons.lang3.ObjectUtils.isEmpty(projectExtras)) {
-            projectJson.putAll(projectExtras);
-        }
-
-        projectJson.put("sceneNum", sceneNum);
-        FileUtils.writeFile(path + File.separator + "project.json", projectJson.toString());
-        JSONObject dataJson = new JSONObject();
-        if (!org.apache.commons.lang3.ObjectUtils.isEmpty(dataExtras)) {
-            dataJson.putAll(dataExtras);
-        }
-
-        dataJson.put("split_type", splitType);
-        dataJson.put("skybox_type", skyboxType);
-        dataJson.put("extras", (Object)null);
-        dataJson.put("other_type", otherType);
-        FileUtils.writeFile(path + File.separator + "data.json", dataJson.toString());
-    }
-
 
 }