Commit 510918c7 by gdj

完善框选变焦CAMERA_POINT_FOCUS_ACTION。

parent 10d1a720
package com.dji.sdk.cloudapi.control;
import com.dji.sdk.cloudapi.device.PayloadIndex;
import com.dji.sdk.common.BaseModel;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
/**
* @author guan
* @date 2025/5/13
*/
public class CameraFrameZoomRequest extends BaseModel {
@NotNull
private PayloadIndex payloadIndex;
@NotNull
private CameraTypeEnum cameraType;
/**
* true: Lock the gimbal, the gimbal and the drone rotate together.
* false: Only the gimbal rotates, but the drone does not.
*/
@NotNull
private Boolean locked;
/**
* upper left corner as center point
*/
@Min(0)
@Max(1)
private Float x;
@Min(0)
@Max(1)
private Float y;
@Min(0)
@Max(1)
private Float width;
@Min(0)
@Max(1)
private Float height;
public CameraFrameZoomRequest() {
}
@Override
public String toString() {
return "CameraAimRequest{" +
"payloadIndex=" + payloadIndex +
", cameraType=" + cameraType +
", locked=" + locked +
", x=" + x +
", y=" + y +
", width=" + width +
", height=" + height +
'}';
}
public PayloadIndex getPayloadIndex() {
return payloadIndex;
}
public CameraFrameZoomRequest setPayloadIndex(PayloadIndex payloadIndex) {
this.payloadIndex = payloadIndex;
return this;
}
public CameraTypeEnum getCameraType() {
return cameraType;
}
public CameraFrameZoomRequest setCameraType(CameraTypeEnum cameraType) {
this.cameraType = cameraType;
return this;
}
public Boolean getLocked() {
return locked;
}
public CameraFrameZoomRequest setLocked(Boolean locked) {
this.locked = locked;
return this;
}
public Float getX() {
return x;
}
public CameraFrameZoomRequest setX(Float x) {
this.x = x;
return this;
}
public Float getY() {
return y;
}
public CameraFrameZoomRequest setY(Float y) {
this.y = y;
return this;
}
public Float getWidth() {
return width;
}
public CameraFrameZoomRequest setWidth(Float width) {
this.width = width;
return this;
}
public Float getHeight() {
return height;
}
public CameraFrameZoomRequest setHeight(Float height) {
this.height = height;
return this;
}
}
......@@ -35,6 +35,8 @@ public enum ControlMethodEnum {
CAMERA_AIM("camera_aim"),
CAMERA_FRAME_ZOOM("camera_frame_zoom"),
CAMERA_FOCAL_LENGTH_SET("camera_focal_length_set"),
GIMBAL_RESET("gimbal_reset"),
......
......@@ -24,6 +24,8 @@ public enum PayloadControlMethodEnum {
CAMERA_AIM(ControlMethodEnum.CAMERA_AIM, CameraAimRequest.class),
CAMERA_FRAME_ZOOM(ControlMethodEnum.CAMERA_FRAME_ZOOM, CameraFrameZoomRequest.class),
CAMERA_FOCAL_LENGTH_SET(ControlMethodEnum.CAMERA_FOCAL_LENGTH_SET, CameraFocalLengthSetRequest.class),
GIMBAL_RESET(ControlMethodEnum.GIMBAL_RESET, GimbalResetRequest.class),
......
......@@ -25,6 +25,7 @@ public enum PayloadCommandsEnum {
CAMERA_AIM(PayloadControlMethodEnum.CAMERA_AIM, CameraAimImpl.class),
CAMERA_POINT_FOCUS_ACTION(PayloadControlMethodEnum.CAMERA_POINT_FOCUS_ACTION, CameraPointFocusActionImpl.class),
CAMERA_FRAME_ZOOM(PayloadControlMethodEnum.CAMERA_FRAME_ZOOM, CameraFrameZoomImpl.class),
CAMERA_FOCAL_LENGTH_SET(PayloadControlMethodEnum.CAMERA_FOCAL_LENGTH_SET, CameraFocalLengthSetImpl.class),
......
package com.dji.sample.control.service.impl;
import com.dji.sample.control.model.param.DronePayloadParam;
import java.util.Objects;
/**
* @author guan
* @date 2025/5/13
*/
public class CameraFrameZoomImpl extends PayloadCommandsHandler {
public CameraFrameZoomImpl(DronePayloadParam param) {
super(param);
}
@Override
public boolean valid() {
return Objects.nonNull(param.getX()) && Objects.nonNull(param.getY())
&& Objects.nonNull(param.getLocked()) && Objects.nonNull(param.getCameraType());
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment