1.镜头模式缓存优化

2.相机对焦模式设置参数优化
3.相机曝光值调节参数优化
This commit is contained in:
sdy 2026-06-04 19:37:53 +08:00
parent 001e997a26
commit e066b29fa0
5 changed files with 13 additions and 6 deletions

View File

@ -165,7 +165,7 @@ public class CameraController {
@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 " +
"13:-1.0EV ...查看接口(获取相机曝光值)")
@RequestParam String value) {
@RequestParam Integer value) {
return new Result<>().ok(cameraService.exposureSet(dockSn, value));
}
@ -175,7 +175,7 @@ public class CameraController {
@Operation(summary = "相机对焦模式设置", description = "注意: Matrice 30 系列飞行器只支持 zoom 镜头下配置该参数")
@RequiresPermissions("bus:camera:focusModeSet")
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) {
return new Result<>().ok(cameraService.focusModeSet(dockSn, mode));

View File

@ -16,13 +16,20 @@ import lombok.Data;
@Schema(name = "变焦参数")
public class FocalLengthSet {
// @NotBlank(message = "相机模式不能为空")
@Schema(description = "相机模式 ir:红外 wide:广角 zoom:变焦", hidden = true)
@Schema(description = "相机模式 ir:红外 zoom:变焦", hidden = true)
private String cameraType;
@NotNull(message = "变焦倍数不能为空")
@Schema(description = "变焦倍数可见光是2-200红外是2-20")
private Double zoomFactor;
@JsonIgnore
@Schema(hidden = true)
@AssertTrue(message = "相机模式设当前为广角,无法变焦")
public boolean isCameraTypeValid() {
return !cameraType.equals("wide");
}
@JsonIgnore
@Schema(hidden = true)
@AssertTrue(message = "变焦倍数设置错误")

View File

@ -47,7 +47,7 @@ public interface CameraService {
String exposureModeSet(String dockSn, Integer mode);
//相机曝光值调节
String exposureSet(String dockSn, String value);
String exposureSet(String dockSn, Integer value);
//相机对焦模式设置
String focusModeSet(String dockSn, Integer mode);

View File

@ -135,7 +135,7 @@ public class CameraServiceImpl implements CameraService {
}
@Override
public String exposureSet(String dockSn, String value) {
public String exposureSet(String dockSn, Integer value) {
JSONObject data = getDataIncludePayloadIndex(dockSn);
Object videoType = CacheUtils.get(BusinessConstant.UAV_VIDEO_TYPE + dockSn);
data.set("camera_type", Objects.requireNonNullElse(videoType, "wide"));

View File

@ -73,7 +73,7 @@ public class LiveServiceImpl implements LiveService {
JSONObject data = new JSONObject();
data.set("video_type", videoType);
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;
}