|
@@ -1,13 +1,20 @@
|
|
|
package com.fdkankan.modeling.receiver;
|
|
|
|
|
|
+import cn.hutool.core.io.FileUtil;
|
|
|
+import cn.hutool.core.io.watch.WatchMonitor;
|
|
|
+import cn.hutool.core.io.watch.Watcher;
|
|
|
+import cn.hutool.core.lang.Console;
|
|
|
+import cn.hutool.core.util.ObjectUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.fdkankan.common.constant.CommonOperStatus;
|
|
|
import com.fdkankan.common.constant.ModelingBuildStatus;
|
|
|
+import com.fdkankan.common.util.CmdUtils;
|
|
|
import com.fdkankan.common.util.FileUtils;
|
|
|
import com.fdkankan.model.utils.ComputerUtil;
|
|
|
import com.fdkankan.model.utils.CreateObjUtil;
|
|
|
import com.fdkankan.modeling.bean.BuildSceneResultBean;
|
|
|
+import com.fdkankan.modeling.constants.CmdConstant;
|
|
|
import com.fdkankan.modeling.constants.RedisKey;
|
|
|
import com.fdkankan.modeling.constants.SysConstants;
|
|
|
import com.fdkankan.modeling.entity.BuildLog;
|
|
@@ -283,10 +290,38 @@ public class RabbitMqListener {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- log.info("八目上完oss结束修改数据:"+num);
|
|
|
+ //平面图ai识别
|
|
|
+ boolean detFloorplan = this.detFloorplan(path);
|
|
|
+ buildSceneResult.setDetFloorplan(detFloorplan);
|
|
|
+
|
|
|
return ModelingBuildStatus.SUCCESS;
|
|
|
}
|
|
|
|
|
|
+ private boolean detFloorplan(String path) throws Exception {
|
|
|
+ String workDir = path + "/detFloorplan/";
|
|
|
+ if(FileUtil.exist(workDir)){
|
|
|
+ FileUtil.del(workDir);
|
|
|
+ }
|
|
|
+ String detectPath = workDir + "detect.json";
|
|
|
+ String imgPath = workDir + "final_freespace.png";
|
|
|
+ String keyPath = path + "/results/laserData/cover/final_freespace.png";
|
|
|
+ String floorKeyPath = path + "/results/floorplan/floor_0.png";
|
|
|
+ if(!FileUtil.exist(floorKeyPath)){
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ FileUtil.copyContent(new File(floorKeyPath), new File(imgPath), true);
|
|
|
+ String cmd = CmdConstant.LAYOUT_DETECT;
|
|
|
+ cmd = cmd.replace("@in", imgPath);
|
|
|
+ cmd = cmd.replace("@out", detectPath);
|
|
|
+ CmdUtils.callLine(cmd, 50);
|
|
|
+ if (ComputerUtil.checkComputeCompleted(detectPath,5, 500)) {
|
|
|
+ return true;
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
private void afterBuild(BuildSceneCallMessage message, BuildSceneResultBean buildSceneResult, BuildLog buildLog){
|
|
|
ModelingBuildStatus buildStatus = null;
|
|
|
try {
|