|
@@ -6,6 +6,7 @@ import api.common.util.FileUtil;
|
|
|
import api.common.util.LinuxUtil;
|
|
|
import api.common.util.StringUtil;
|
|
|
import com.css.simulation.resource.video.mapper.ConfigMapper;
|
|
|
+import com.css.simulation.resource.video.mapper.DictMapper;
|
|
|
import com.css.simulation.resource.video.mapper.SimulationAutomaticProjectMapper;
|
|
|
import com.css.simulation.resource.video.mapper.VehicleMapper;
|
|
|
import com.css.simulation.resource.video.pojo.po.VehiclePO;
|
|
@@ -31,6 +32,7 @@ import java.math.RoundingMode;
|
|
|
import java.nio.file.Files;
|
|
|
import java.nio.file.Paths;
|
|
|
import java.util.Iterator;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
@Service
|
|
|
@Slf4j
|
|
@@ -43,8 +45,8 @@ public class VideoService {
|
|
|
SimulationAutomaticProjectMapper simulationAutomaticProjectMapper;
|
|
|
@Resource
|
|
|
MinioClient minioClient;
|
|
|
-
|
|
|
-
|
|
|
+ @Resource
|
|
|
+ DictMapper dictMapper;
|
|
|
//* -------------------------------- Comment --------------------------------
|
|
|
|
|
|
public static final String oldXoscName = "simulation_my0.xosc";
|
|
@@ -135,7 +137,7 @@ public class VideoService {
|
|
|
* 修改 xosc 文件
|
|
|
*/
|
|
|
@SneakyThrows
|
|
|
- private String modifyXosc(String oldXoscPath, String xodrPath, String osgbPath, String projectId, String projectType) {
|
|
|
+ public String modifyXosc(String oldXoscPath, String xodrPath, String osgbPath, String projectId, String projectType) {
|
|
|
String newXoscPath = oldXoscPath.replace(oldXoscName, newXoscName);
|
|
|
//获取三维自车对象
|
|
|
VehicleTypePO po = vehicleById(projectId, projectType);
|
|
@@ -167,7 +169,7 @@ public class VideoService {
|
|
|
Attribute vehicleCategory = node3.attribute("vehicleCategory");
|
|
|
vehicleCategory.setText(po.getVehicleCategory());
|
|
|
//node3.addAttribute("model3d", po.getModel3d());//自车渲染
|
|
|
- if(po.getModel3d().equals("")||po.getModel3d()==null){
|
|
|
+ if(po.getModel3d()==null||po.getModel3d().equals("")){
|
|
|
node3.addAttribute("model3d", "/root/disk1/simulation-cloud/esmini/resources/models/car_red.osgb");//自车渲染
|
|
|
}else{
|
|
|
log.info(" 车辆类型为 为:"+po.getVehicleCategory()+" 渲染文件为:" + po.getModel3d());
|
|
@@ -314,14 +316,16 @@ public class VideoService {
|
|
|
po.setVehicleCategory("bicycle");
|
|
|
} else if (car.contains("train")) {
|
|
|
po.setVehicleCategory("train");
|
|
|
- } else if(car.contains("suv")) {
|
|
|
+ } else if(car.equalsIgnoreCase("suv")) {
|
|
|
po.setVehicleCategory("suv");
|
|
|
- po.setModel3d("/root/disk1/simulation-cloud/esmini/resources/models/audiq5.osgb");
|
|
|
+ // po.setModel3d("/root/disk1/simulation-cloud/esmini/resources/models/audiq5.osgb");
|
|
|
}else {
|
|
|
po.setVehicleCategory("car");
|
|
|
- po.setModel3d("/root/disk1/simulation-cloud/esmini/resources/models/audia8.osgb");
|
|
|
+ // po.setModel3d("/root/disk1/simulation-cloud/esmini/resources/models/audia8.osgb");
|
|
|
}
|
|
|
-
|
|
|
+ //从字段取自车渲染osgb
|
|
|
+ String carPath=dictMapper.getCarPath(po.getVehicleCategory());
|
|
|
+ po.setModel3d(carPath);
|
|
|
//车前距
|
|
|
BigDecimal frontDistance = vehicleInfo.getFrontDistance();
|
|
|
//车后距
|