From bfac293c7866f92e074f7c8bf92e6548e1ce3768 Mon Sep 17 00:00:00 2001
From: Xiajijian <1176061145@qq.com>
Date: Fri, 28 Nov 2025 16:45:13 +0800
Subject: [PATCH] 1.哈尔滨增加,另一个Minio配置。
---
ard-route/src/main/java/com/ard/route/util/RouteFileUtils.java | 213 +++++++++++++++++++++++++---------------------------
1 files changed, 102 insertions(+), 111 deletions(-)
diff --git a/ard-route/src/main/java/com/ard/route/util/RouteFileUtils.java b/ard-route/src/main/java/com/ard/route/util/RouteFileUtils.java
index cff95f2..3573eeb 100644
--- a/ard-route/src/main/java/com/ard/route/util/RouteFileUtils.java
+++ b/ard-route/src/main/java/com/ard/route/util/RouteFileUtils.java
@@ -3,8 +3,8 @@
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
-import com.ard.route.domain.*;
-import com.ard.route.domain.kml.*;
+import com.ard.route.domain.djuav.*;
+import com.ard.route.domain.djuav.kml.*;
import com.ard.route.enums.kml.*;
import com.ard.route.constant.FileTypeConstants;
import com.thoughtworks.xstream.XStream;
@@ -21,21 +21,12 @@
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
+import static com.ard.route.util.ToolUtils.XML_HEADER;
+
/**
* 航线文件操作工具类
*/
public class RouteFileUtils {
-
- /**
- * XML 头部
- */
- private static final String XML_HEADER = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
-
- /**
- * 生成的本地 kmz 文件存储路径
- */
- private static final String LOCAL_KMZ_FILE_PATH = "file" + File.separator + "kmz" + File.separator;
-
/**
* kml文件解析
@@ -45,26 +36,14 @@
*/
public static KmlInfo parseKml(InputStream inputStream) {
XStream xStream = new XStream();
- xStream.allowTypes(new Class[]{KmlInfo.class, KmlAction.class, KmlWayLineCoordinateSysParam.class, KmlPoint.class});
+ xStream.allowTypes(new Class[]{KmlInfo.class, KmlAction.class, KmlWayLineCoordinateSysParam.class, KmlPoint.class, KmlActionGroup.class});
xStream.alias("kml", KmlInfo.class);
xStream.processAnnotations(KmlInfo.class);
xStream.autodetectAnnotations(true);
xStream.ignoreUnknownElements();
xStream.addImplicitCollection(KmlActionGroup.class, "action");
+ xStream.addImplicitCollection(KmlPlacemark.class, "actionGroup");
return (KmlInfo) xStream.fromXML(inputStream);
- }
-
- /**
- * 生成航线 KMZ 文件
- *
- * @param fileName 文件名
- * @param kmlParams 参数对象
- * @return 本地文件路径
- */
- public static String buildKmz(String fileName, KmlParams kmlParams) {
- KmlInfo kmlInfo = buildKml(kmlParams);
- KmlInfo wpmlInfo = buildWpml(kmlParams);
- return buildKmz(fileName, kmlInfo, wpmlInfo);
}
/**
@@ -75,15 +54,16 @@
* @param wpmlInfo wpml 文件信息
* @return 本地文件路径
*/
- public static String buildKmz(String fileName, KmlInfo kmlInfo, KmlInfo wpmlInfo) {
+ public static String buildKmzA(String fileName, KmlInfo kmlInfo, KmlInfo wpmlInfo, String kmzFilePath) {
XStream xStream = new XStream(new DomDriver());
xStream.processAnnotations(KmlInfo.class);
xStream.addImplicitCollection(KmlActionGroup.class, "action");
+ xStream.addImplicitCollection(KmlPlacemark.class, "actionGroup");
String kml = XML_HEADER + xStream.toXML(kmlInfo);
String wpml = XML_HEADER + xStream.toXML(wpmlInfo);
- try (FileOutputStream fileOutputStream = new FileOutputStream(LOCAL_KMZ_FILE_PATH + fileName + ".kmz");
+ try (FileOutputStream fileOutputStream = new FileOutputStream(kmzFilePath + fileName + ".kmz");
ZipOutputStream zipOutputStream = new ZipOutputStream(fileOutputStream)) {
zipOutputStream.setLevel(0); // 0 表示不压缩,存储方式
@@ -96,10 +76,10 @@
} catch (Exception e) {
throw new RuntimeException(e);
}
- return LOCAL_KMZ_FILE_PATH + fileName + ".kmz";
+ return kmzFilePath + fileName + ".kmz";
}
- private static void buildZipFile(String name, ZipOutputStream zipOutputStream, String content) throws IOException {
+ public static void buildZipFile(String name, ZipOutputStream zipOutputStream, String content) throws IOException {
ZipEntry kmlEntry = new ZipEntry(name);
zipOutputStream.putNextEntry(kmlEntry);
// 将内容写入 ZIP 条目
@@ -112,7 +92,6 @@
}
zipOutputStream.closeEntry(); // 关闭条目
}
-
public static KmlInfo buildKml(KmlParams kmlParams) {
KmlInfo kmlInfo = new KmlInfo();
@@ -129,7 +108,7 @@
public static KmlDocument buildKmlDocument(String fileType, KmlParams kmlParams) {
KmlDocument kmlDocument = new KmlDocument();
if (StringUtils.equals(fileType, FileTypeConstants.KML)) {
- kmlDocument.setAuthor("Cleaner");
+ kmlDocument.setAuthor("Ard-Creator");
kmlDocument.setCreateTime(String.valueOf(DateUtil.current()));
kmlDocument.setUpdateTime(String.valueOf(DateUtil.current()));
}
@@ -140,7 +119,11 @@
public static KmlMissionConfig buildKmlMissionConfig(KmlParams kmlParams) {
KmlMissionConfig kmlMissionConfig = new KmlMissionConfig();
- kmlMissionConfig.setFlyToWayLineMode(FlyToWaylineModeEnums.SAFELY.getValue());
+ if (kmlParams.getFlyToWaylineMode() != null){
+ kmlMissionConfig.setFlyToWayLineMode(kmlParams.getFlyToWaylineMode());
+ }else {
+ kmlMissionConfig.setFlyToWayLineMode(FlyToWaylineModeEnums.SAFELY.getValue());
+ }
kmlMissionConfig.setFinishAction(kmlParams.getFinishAction());
if (StringUtils.isNotBlank(kmlParams.getExitOnRcLostAction())) {
kmlMissionConfig.setExitOnRCLost(ExitOnRCLostEnums.EXECUTE_LOST_ACTION.getValue());
@@ -149,7 +132,11 @@
kmlMissionConfig.setExitOnRCLost(ExitOnRCLostEnums.GO_CONTINUE.getValue());
}
kmlMissionConfig.setTakeOffSecurityHeight("20");
- kmlMissionConfig.setGlobalTransitionalSpeed("15");
+ if (kmlParams.getGlobalTransitionalSpeed() != null){
+ kmlMissionConfig.setGlobalTransitionalSpeed(String.valueOf(kmlParams.getGlobalTransitionalSpeed()));
+ }else {
+ kmlMissionConfig.setGlobalTransitionalSpeed("15");
+ }
kmlMissionConfig.setGlobalRTHHeight("100");
kmlMissionConfig.setTakeOffRefPoint(kmlParams.getTakeOffRefPoint());
kmlMissionConfig.setDroneInfo(buildKmlDroneInfo(kmlParams.getDroneType(), kmlParams.getSubDroneType()));
@@ -173,9 +160,7 @@
kmlPayloadInfo.setPayloadEnumValue(String.valueOf(payloadType));
kmlPayloadInfo.setPayloadPositionIndex(String.valueOf(payloadPosition));
return kmlPayloadInfo;
-
}
-
public static KmlFolder buildKmlFolder(String fileType, KmlParams kmlParams) {
KmlFolder kmlFolder = new KmlFolder();
@@ -183,13 +168,18 @@
kmlFolder.setAutoFlightSpeed(String.valueOf(kmlParams.getAutoFlightSpeed()));
if (StringUtils.equals(fileType, FileTypeConstants.KML)) {
kmlFolder.setTemplateType(kmlParams.getTemplateType());
- kmlFolder.setWaylineCoordinateSysParam(buildKmlWayLineCoordinateSysParam(TemplateTypeEnums.WAYPOINT.getValue()));
+ kmlFolder.setWaylineCoordinateSysParam(buildKmlWayLineCoordinateSysParam(kmlParams.getTemplateType(), HeightModeEnums.RELATIVE_TO_START_POINT.getValue(),
+ String.valueOf(kmlParams.getGlobalHeight())));
kmlFolder.setPayloadParam(buildKmlPayloadParam(kmlParams));
}
if (StringUtils.equals(fileType, FileTypeConstants.WPML)) {
kmlFolder.setWaylineId("0");
kmlFolder.setExecuteHeightMode(ExecuteHeightModeEnums.RELATIVE_TO_START_POINT.getValue());
- // TODO 航线初始动作
+ if (CollectionUtil.isNotEmpty(kmlParams.getStartActionList())) {
+ KmlActionGroup kmlActionGroup = new KmlActionGroup();
+ kmlActionGroup.setAction(getKmlActionList(kmlParams.getStartActionList(), kmlParams));
+ kmlFolder.setStartActionGroup(kmlActionGroup);
+ }
}
// 航点类型模板航线配置
if (StringUtils.equals(kmlFolder.getTemplateType(), TemplateTypeEnums.WAYPOINT.getValue())) {
@@ -230,12 +220,6 @@
if (CollectionUtil.isNotEmpty(routePointList)) {
List<KmlPlacemark> kmlPlacemarkList = new ArrayList<>();
for (RoutePointInfo routePointInfo : routePointList) {
-// ActionTriggerReq actionTriggerReq = new ActionTriggerReq();
-// actionTriggerReq.setActionTriggerType(StringUtils.equals(kmlParams.getMappingTypeReq().getShootType(), ShootTypeEnums.TIME.getValue()) ?
-// ActionTriggerTypeEnums.MULTIPLE_TIMING.getValue() :
-// ActionTriggerTypeEnums.MULTIPLE_DISTANCE.getValue());
-// actionTriggerReq.setActionTriggerParam(2.0);
-// RoutePointInfo.setActionTriggerReq(actionTriggerReq);
kmlPlacemarkList.add(buildKmlPlacemark(routePointInfo, kmlParams, fileType));
}
kmlFolder.setPlacemarkList(kmlPlacemarkList);
@@ -245,18 +229,56 @@
return kmlFolder;
}
+ /**
+ * 构建航点动作
+ *
+ * @param actionList 航点动作列表
+ * @param kmlParams
+ * @return
+ */
+ private static List<KmlAction> getKmlActionList(List<PointActionReq> actionList, KmlParams kmlParams) {
+ List<KmlAction> kmlActionList = new ArrayList<>();
+ for (PointActionReq pointActionReq : actionList) {
+ if (ObjectUtil.isNotNull(pointActionReq.getHoverTime())) {
+ kmlActionList.add(buildKmlAction(String.valueOf(pointActionReq.getActionIndex()), ActionActuatorFuncEnums.HOVER.getValue(), pointActionReq, kmlParams));
+ } else if (ObjectUtil.isNotNull(pointActionReq.getAircraftHeading())) {
+ kmlActionList.add(buildKmlAction(String.valueOf(pointActionReq.getActionIndex()), ActionActuatorFuncEnums.ROTATE_YAW.getValue(), pointActionReq, kmlParams));
+ } else if (ObjectUtil.isNotNull(pointActionReq.getTakePhotoType()) && ObjectUtil.equals(pointActionReq.getTakePhotoType(), 0)) {
+ kmlActionList.add(buildKmlAction(String.valueOf(pointActionReq.getActionIndex()), ActionActuatorFuncEnums.TAKE_PHOTO.getValue(), pointActionReq, kmlParams));
+ } else if ((ObjectUtil.isNotNull(pointActionReq.getGimbalYawRotateAngle())) || (ObjectUtil.isNotNull(pointActionReq.getGimbalPitchRotateAngle()))) {
+ kmlActionList.add(buildKmlAction(String.valueOf(pointActionReq.getActionIndex()), ActionActuatorFuncEnums.GIMBAL_ROTATE.getValue(), pointActionReq, kmlParams));
+ } else if (ObjectUtil.isNotNull(pointActionReq.getZoom())) {
+ kmlActionList.add(buildKmlAction(String.valueOf(pointActionReq.getActionIndex()), ActionActuatorFuncEnums.ZOOM.getValue(), pointActionReq, kmlParams));
+ } else if (ObjectUtil.isNotNull(pointActionReq.getTakePhotoType()) && ObjectUtil.equals(pointActionReq.getTakePhotoType(), 1)) {
+ kmlActionList.add(buildKmlAction(String.valueOf(pointActionReq.getActionIndex()), ActionActuatorFuncEnums.PANO_SHOT.getValue(), pointActionReq, kmlParams));
+ } else if (ObjectUtil.isNotNull(pointActionReq.getStartRecord()) && pointActionReq.getStartRecord()) {
+ kmlActionList.add(buildKmlAction(String.valueOf(pointActionReq.getActionIndex()), ActionActuatorFuncEnums.START_RECORD.getValue(), pointActionReq, kmlParams));
+ } else if (ObjectUtil.isNotNull(pointActionReq.getStopRecord()) && pointActionReq.getStopRecord()) {
+ kmlActionList.add(buildKmlAction(String.valueOf(pointActionReq.getActionIndex()), ActionActuatorFuncEnums.STOP_RECORD.getValue(), pointActionReq, kmlParams));
+ }
+ }
+ return kmlActionList;
+ }
- public static KmlWayLineCoordinateSysParam buildKmlWayLineCoordinateSysParam(String templateType) {
+ /**
+ * 构造坐标系参数信息
+ *
+ * @param templateType 航线模板类型
+ * @param heightMode 高度模式
+ * @param height 高度
+ * @return 坐标系参数信息
+ */
+ public static KmlWayLineCoordinateSysParam buildKmlWayLineCoordinateSysParam(String templateType, String heightMode, String height) {
KmlWayLineCoordinateSysParam kmlWayLineCoordinateSysParam = new KmlWayLineCoordinateSysParam();
kmlWayLineCoordinateSysParam.setCoordinateMode("WGS84");
- kmlWayLineCoordinateSysParam.setHeightMode(HeightModeEnums.RELATIVE_TO_START_POINT.getValue());
+ kmlWayLineCoordinateSysParam.setHeightMode(heightMode);
kmlWayLineCoordinateSysParam.setPositioningType(PositioningTypeEnums.GPS.getValue());
if (StringUtils.equals(templateType, TemplateTypeEnums.MAPPING2D.getValue()) ||
StringUtils.equals(templateType, TemplateTypeEnums.MAPPING3D.getValue()) ||
StringUtils.equals(templateType, TemplateTypeEnums.MAPPING_STRIP.getValue())) {
- kmlWayLineCoordinateSysParam.setGlobalShootHeight("50");
+ kmlWayLineCoordinateSysParam.setGlobalShootHeight(height);
kmlWayLineCoordinateSysParam.setSurfaceFollowModeEnable("1");
- kmlWayLineCoordinateSysParam.setSurfaceRelativeHeight("100");
+ kmlWayLineCoordinateSysParam.setSurfaceRelativeHeight(height);
}
return kmlWayLineCoordinateSysParam;
}
@@ -275,7 +297,6 @@
// 0: 不上色 1: 真彩上色
kmlPayloadParam.setModelColoringEnable("1");
kmlPayloadParam.setImageFormat(kmlParams.getImageFormat());
-
return kmlPayloadParam;
}
@@ -290,7 +311,6 @@
}
kmlGlobalWaypointHeadingParam.setWaypointHeadingPathMode(WaypointHeadingPathModeEnums.FOLLOW_BAD_ARC.getValue());
return kmlGlobalWaypointHeadingParam;
-
}
public static KmlPlacemark buildKmlPlacemark(RoutePointInfo routePointInfo, KmlParams kmlParams, String fileType) {
@@ -308,8 +328,12 @@
kmlPlacemark.setGimbalPitchAngle(String.valueOf(routePointInfo.getGimbalPitchAngle()));
}
}
- if (CollectionUtil.isNotEmpty(routePointInfo.getActions())) {
- kmlPlacemark.setActionGroup(buildKmlActionGroup(routePointInfo, kmlParams));
+ if (CollectionUtil.isNotEmpty(routePointInfo.getActionGroupList())) {
+ List<KmlActionGroup> kmlActionGroupList = new ArrayList<>();
+ for (ActionGroupReq actionGroupReq : routePointInfo.getActionGroupList()) {
+ kmlActionGroupList.add(buildKmlActionGroup(actionGroupReq, kmlParams));
+ }
+ kmlPlacemark.setActionGroup(kmlActionGroupList);
}
return kmlPlacemark;
}
@@ -333,22 +357,16 @@
private static KmlOverlap buildKmlOverlap(String collectionMethod, String lensType, Integer overlapH, Integer overlapW) {
KmlOverlap overlap = new KmlOverlap();
- if (StringUtils.equals(collectionMethod, CollectionMethodEnums.ORTHO.getValue())) {
- if (StringUtils.equals(lensType, LensTypeEnums.LIDAR.getValue())) {
- overlap.setOrthoLidarOverlapH(String.valueOf(overlapH));
- overlap.setOrthoLidarOverlapW(String.valueOf(overlapW));
- } else {
- overlap.setOrthoCameraOverlapH(String.valueOf(overlapH));
- overlap.setOrthoCameraOverlapW(String.valueOf(overlapW));
- }
+ if (StringUtils.equals(collectionMethod, LensTypeEnums.CAMERA.getValue())) {
+ overlap.setOrthoCameraOverlapH(String.valueOf(overlapH));
+ overlap.setOrthoCameraOverlapW(String.valueOf(overlapW));
+ overlap.setInclinedCameraOverlapW(String.valueOf(overlapW));
+ overlap.setInclinedCameraOverlapH(String.valueOf(overlapH));
} else {
- if (StringUtils.equals(lensType, LensTypeEnums.LIDAR.getValue())) {
- overlap.setInclinedLidarOverlapH(String.valueOf(overlapH));
- overlap.setInclinedCameraOverlapW(String.valueOf(overlapW));
- } else {
- overlap.setInclinedCameraOverlapH(String.valueOf(overlapH));
- overlap.setInclinedCameraOverlapW(String.valueOf(overlapW));
- }
+ overlap.setOrthoLidarOverlapH(String.valueOf(overlapH));
+ overlap.setOrthoLidarOverlapW(String.valueOf(overlapW));
+ overlap.setInclinedLidarOverlapH(String.valueOf(overlapH));
+ overlap.setInclinedLidarOverlapW(String.valueOf(overlapW));
}
return overlap;
}
@@ -356,7 +374,6 @@
private static KmlPolygon buildKmlPolygon(List<CoordinatePointReq> coordinatePointReqList) {
KmlPolygon kmlPolygon = new KmlPolygon();
KmlLinearRing kmlLinearRing = new KmlLinearRing();
-
String coordinates = coordinatePointReqList.stream().map(point -> point.getLongitude() + "," + point.getLatitude() + "," + point.getHeight())
.collect(Collectors.joining(", "));
kmlLinearRing.setCoordinates(StringUtils.join(coordinates, " "));
@@ -405,9 +422,7 @@
kmlPlacemark.setWaypointHeadingParam(buildKmlWaypointHeadingParam(globalWaypointHeading.getWaypointHeadingMode(), globalWaypointHeading.getWaypointHeadingAngle(), globalWaypointHeading.getWaypointPoiPoint()));
}
}
-
}
-
private static void handleSpeed(RoutePointInfo routePointInfo, KmlParams kmlParams, String fileType, KmlPlacemark kmlPlacemark) {
if (ObjectUtil.isNotEmpty(routePointInfo.getSpeed())) {
@@ -477,47 +492,15 @@
return kmlWaypointTurnParam;
}
- public static KmlActionGroup buildKmlActionGroup(RoutePointInfo routePointInfo, KmlParams kmlParams) {
+ public static KmlActionGroup buildKmlActionGroup(ActionGroupReq actionGroupReq, KmlParams kmlParams) {
KmlActionGroup kmlActionGroup = new KmlActionGroup();
- kmlActionGroup.setActionGroupId(String.valueOf(routePointInfo.getRoutePointIndex()));
- kmlActionGroup.setActionGroupStartIndex(String.valueOf(routePointInfo.getRoutePointIndex()));
- kmlActionGroup.setActionGroupEndIndex(String.valueOf(ObjectUtil.isNotNull(routePointInfo.getEndIntervalRouteIndex()) ?
- routePointInfo.getEndIntervalRouteIndex() : routePointInfo.getRoutePointIndex()));
+ kmlActionGroup.setActionGroupId(String.valueOf(actionGroupReq.getActionGroupId()));
+ kmlActionGroup.setActionGroupStartIndex(String.valueOf(actionGroupReq.getActionGroupStartIndex()));
+ kmlActionGroup.setActionGroupEndIndex(String.valueOf(actionGroupReq.getActionGroupEndIndex()));
kmlActionGroup.setActionGroupMode(ActionGroupModeEnums.SEQUENCE.getValue());
- String actionTriggerType = ActionTriggerTypeEnums.REACH_POINT.getValue();
- Double actionTriggerParam = 0.0;
- if (ObjectUtil.isNotNull(routePointInfo.getTimeInterval())) {
- actionTriggerType = ActionTriggerTypeEnums.MULTIPLE_TIMING.getValue();
- actionTriggerParam = routePointInfo.getTimeInterval();
- } else if (ObjectUtil.isNotNull(routePointInfo.getDistanceInterval())) {
- actionTriggerType = ActionTriggerTypeEnums.MULTIPLE_DISTANCE.getValue();
- actionTriggerParam = routePointInfo.getDistanceInterval();
- }
-
- kmlActionGroup.setActionTrigger(buildKmlActionTrigger(actionTriggerType, actionTriggerParam));
- List<KmlAction> kmlActionList = new ArrayList<>();
- for (PointActionReq pointActionReq : routePointInfo.getActions()) {
- if (ObjectUtil.isNotNull(pointActionReq.getHoverTime())) {
- kmlActionList.add(buildKmlAction(String.valueOf(pointActionReq.getActionIndex()), ActionActuatorFuncEnums.HOVER.getValue(), pointActionReq, kmlParams));
- } else if (ObjectUtil.isNotNull(pointActionReq.getAircraftHeading())) {
- kmlActionList.add(buildKmlAction(String.valueOf(pointActionReq.getActionIndex()), ActionActuatorFuncEnums.ROTATE_YAW.getValue(), pointActionReq, kmlParams));
- } else if (ObjectUtil.isNotNull(pointActionReq.getTakePhotoType()) && ObjectUtil.equals(pointActionReq.getTakePhotoType(), 0)) {
- kmlActionList.add(buildKmlAction(String.valueOf(pointActionReq.getActionIndex()), ActionActuatorFuncEnums.TAKE_PHOTO.getValue(), pointActionReq, kmlParams));
- } else if ((ObjectUtil.isNotNull(pointActionReq.getGimbalYawRotateAngle())) || (ObjectUtil.isNotNull(pointActionReq.getGimbalPitchRotateAngle()))) {
- kmlActionList.add(buildKmlAction(String.valueOf(pointActionReq.getActionIndex()), ActionActuatorFuncEnums.GIMBAL_ROTATE.getValue(), pointActionReq, kmlParams));
- } else if (ObjectUtil.isNotNull(pointActionReq.getZoom())) {
- kmlActionList.add(buildKmlAction(String.valueOf(pointActionReq.getActionIndex()), ActionActuatorFuncEnums.ZOOM.getValue(), pointActionReq, kmlParams));
- } else if (ObjectUtil.isNotNull(pointActionReq.getTakePhotoType()) && ObjectUtil.equals(pointActionReq.getTakePhotoType(), 1)) {
- kmlActionList.add(buildKmlAction(String.valueOf(pointActionReq.getActionIndex()), ActionActuatorFuncEnums.PANO_SHOT.getValue(), pointActionReq, kmlParams));
- } else if (ObjectUtil.isNotNull(pointActionReq.getStartRecord()) && pointActionReq.getStartRecord()) {
- kmlActionList.add(buildKmlAction(String.valueOf(pointActionReq.getActionIndex()), ActionActuatorFuncEnums.START_RECORD.getValue(), pointActionReq, kmlParams));
- } else if (ObjectUtil.isNotNull(pointActionReq.getStopRecord()) && pointActionReq.getStopRecord()) {
- kmlActionList.add(buildKmlAction(String.valueOf(pointActionReq.getActionIndex()), ActionActuatorFuncEnums.STOP_RECORD.getValue(), pointActionReq, kmlParams));
- }
-
- }
- kmlActionGroup.setAction(kmlActionList);
+ kmlActionGroup.setActionTrigger(buildKmlActionTrigger(actionGroupReq.getActionTriggerType(), actionGroupReq.getActionTriggerParam()));
+ kmlActionGroup.setAction(getKmlActionList(actionGroupReq.getActions(), kmlParams));
return kmlActionGroup;
}
@@ -544,7 +527,11 @@
if (StringUtils.equals(actionActuatorFunc, ActionActuatorFuncEnums.TAKE_PHOTO.getValue()) ||
StringUtils.equals(actionActuatorFunc, ActionActuatorFuncEnums.START_RECORD.getValue())) {
kmlActionActuatorFuncParam.setPayloadPositionIndex(String.valueOf(kmlParams.getPayloadPosition()));
- kmlActionActuatorFuncParam.setFileSuffix("");
+ if (pointActionReq.getFileSuffix() != null){
+ kmlActionActuatorFuncParam.setFileSuffix(pointActionReq.getFileSuffix());
+ }else {
+ kmlActionActuatorFuncParam.setFileSuffix("panoramicPhoto_360");
+ }
kmlActionActuatorFuncParam.setUseGlobalPayloadLensIndex(String.valueOf(pointActionReq.getUseGlobalImageFormat()));
if (ObjectUtil.equals(pointActionReq.getUseGlobalImageFormat(), 0)) {
kmlActionActuatorFuncParam.setPayloadLensIndex(pointActionReq.getImageFormat());
@@ -586,7 +573,11 @@
} else if (StringUtils.equals(actionActuatorFunc, ActionActuatorFuncEnums.PANO_SHOT.getValue())) {
kmlActionActuatorFuncParam.setPayloadPositionIndex(String.valueOf(kmlParams.getPayloadPosition()));
kmlActionActuatorFuncParam.setUseGlobalPayloadLensIndex(String.valueOf(pointActionReq.getUseGlobalImageFormat()));
- kmlActionActuatorFuncParam.setPanoShotSubMode("panoShot_360");
+ if (pointActionReq.getFileSuffix()!=null){
+ kmlActionActuatorFuncParam.setPanoShotSubMode(pointActionReq.getPanoShotSubMode());
+ }else {
+ kmlActionActuatorFuncParam.setPanoShotSubMode("panoShot_360");
+ }
if (ObjectUtil.equals(pointActionReq.getUseGlobalImageFormat(), 0)) {
kmlActionActuatorFuncParam.setPayloadLensIndex(pointActionReq.getImageFormat());
} else {
--
Gitblit v1.9.3