parent
001e997a26
commit
e066b29fa0
|
|
@ -165,7 +165,7 @@ public class CameraController {
|
||||||
@Parameter(name = "value", description = "曝光值 1:-5.0EV 2:-4.7EV 3:-4.3EV 4:-4.0EV " +
|
@Parameter(name = "value", description = "曝光值 1:-5.0EV 2:-4.7EV 3:-4.3EV 4:-4.0EV " +
|
||||||
"5:-3.7EV 6:-3.3EV 7:-3.0EV 8:-2.7EV 9:-2.3EV 10:-2.0EV 11:-1.7EV 12:-1.3EV " +
|
"5:-3.7EV 6:-3.3EV 7:-3.0EV 8:-2.7EV 9:-2.3EV 10:-2.0EV 11:-1.7EV 12:-1.3EV " +
|
||||||
"13:-1.0EV ...查看接口(获取相机曝光值)")
|
"13:-1.0EV ...查看接口(获取相机曝光值)")
|
||||||
@RequestParam String value) {
|
@RequestParam Integer value) {
|
||||||
|
|
||||||
return new Result<>().ok(cameraService.exposureSet(dockSn, value));
|
return new Result<>().ok(cameraService.exposureSet(dockSn, value));
|
||||||
}
|
}
|
||||||
|
|
@ -175,7 +175,7 @@ public class CameraController {
|
||||||
@Operation(summary = "相机对焦模式设置", description = "注意: Matrice 30 系列飞行器只支持 zoom 镜头下配置该参数")
|
@Operation(summary = "相机对焦模式设置", description = "注意: Matrice 30 系列飞行器只支持 zoom 镜头下配置该参数")
|
||||||
@RequiresPermissions("bus:camera:focusModeSet")
|
@RequiresPermissions("bus:camera:focusModeSet")
|
||||||
public Result<Object> focusModeSet(@PathVariable("dockSn") String dockSn,
|
public Result<Object> focusModeSet(@PathVariable("dockSn") String dockSn,
|
||||||
@Parameter(name = "mode", description = "对焦模式 1:MF 2:AFS 3:AFC")
|
@Parameter(name = "mode", description = "对焦模式 0:MF 1:AFS 2:AFC")
|
||||||
@RequestParam Integer mode) {
|
@RequestParam Integer mode) {
|
||||||
|
|
||||||
return new Result<>().ok(cameraService.focusModeSet(dockSn, mode));
|
return new Result<>().ok(cameraService.focusModeSet(dockSn, mode));
|
||||||
|
|
|
||||||
|
|
@ -16,13 +16,20 @@ import lombok.Data;
|
||||||
@Schema(name = "变焦参数")
|
@Schema(name = "变焦参数")
|
||||||
public class FocalLengthSet {
|
public class FocalLengthSet {
|
||||||
// @NotBlank(message = "相机模式不能为空")
|
// @NotBlank(message = "相机模式不能为空")
|
||||||
@Schema(description = "相机模式 ir:红外 wide:广角 zoom:变焦", hidden = true)
|
@Schema(description = "相机模式 ir:红外 zoom:变焦", hidden = true)
|
||||||
private String cameraType;
|
private String cameraType;
|
||||||
|
|
||||||
@NotNull(message = "变焦倍数不能为空")
|
@NotNull(message = "变焦倍数不能为空")
|
||||||
@Schema(description = "变焦倍数,可见光是2-200,红外是2-20")
|
@Schema(description = "变焦倍数,可见光是2-200,红外是2-20")
|
||||||
private Double zoomFactor;
|
private Double zoomFactor;
|
||||||
|
|
||||||
|
@JsonIgnore
|
||||||
|
@Schema(hidden = true)
|
||||||
|
@AssertTrue(message = "相机模式设当前为广角,无法变焦")
|
||||||
|
public boolean isCameraTypeValid() {
|
||||||
|
return !cameraType.equals("wide");
|
||||||
|
}
|
||||||
|
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
@Schema(hidden = true)
|
@Schema(hidden = true)
|
||||||
@AssertTrue(message = "变焦倍数设置错误")
|
@AssertTrue(message = "变焦倍数设置错误")
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ public interface CameraService {
|
||||||
String exposureModeSet(String dockSn, Integer mode);
|
String exposureModeSet(String dockSn, Integer mode);
|
||||||
|
|
||||||
//相机曝光值调节
|
//相机曝光值调节
|
||||||
String exposureSet(String dockSn, String value);
|
String exposureSet(String dockSn, Integer value);
|
||||||
|
|
||||||
//相机对焦模式设置
|
//相机对焦模式设置
|
||||||
String focusModeSet(String dockSn, Integer mode);
|
String focusModeSet(String dockSn, Integer mode);
|
||||||
|
|
|
||||||
|
|
@ -135,7 +135,7 @@ public class CameraServiceImpl implements CameraService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String exposureSet(String dockSn, String value) {
|
public String exposureSet(String dockSn, Integer value) {
|
||||||
JSONObject data = getDataIncludePayloadIndex(dockSn);
|
JSONObject data = getDataIncludePayloadIndex(dockSn);
|
||||||
Object videoType = CacheUtils.get(BusinessConstant.UAV_VIDEO_TYPE + dockSn);
|
Object videoType = CacheUtils.get(BusinessConstant.UAV_VIDEO_TYPE + dockSn);
|
||||||
data.set("camera_type", Objects.requireNonNullElse(videoType, "wide"));
|
data.set("camera_type", Objects.requireNonNullElse(videoType, "wide"));
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,7 @@ public class LiveServiceImpl implements LiveService {
|
||||||
JSONObject data = new JSONObject();
|
JSONObject data = new JSONObject();
|
||||||
data.set("video_type", videoType);
|
data.set("video_type", videoType);
|
||||||
String result = djiBaseService.executeAndReturnResult(dockSn, "live_lens_change", data);
|
String result = djiBaseService.executeAndReturnResult(dockSn, "live_lens_change", data);
|
||||||
CacheUtils.set(BusinessConstant.UAV_VIDEO_TYPE, videoType);
|
CacheUtils.set(BusinessConstant.UAV_VIDEO_TYPE + dockSn, videoType);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue