修复设备云台控制关于速度的错误描述,水平垂直控制速度为00H~FFH(0-255),变倍控制速度为0H~FH(0-15),聚焦速度为00H~FFH(0-255),光圈速度为00H~FFH(0-255)

pull/1742/head
claire 2025-01-02 14:16:44 +08:00
parent 3367b70c61
commit daeb48f62a
1 changed files with 11 additions and 11 deletions

View File

@ -53,7 +53,7 @@ public class PtzController {
@Parameter(name = "cmdCode", description = "指令码(对应国标文档指令格式中的字节4)", required = true)
@Parameter(name = "parameter1", description = "数据一(对应国标文档指令格式中的字节5, 范围0-255)", required = true)
@Parameter(name = "parameter2", description = "数据二(对应国标文档指令格式中的字节6, 范围0-255)", required = true)
@Parameter(name = "combindCode2", description = "组合码二(对应国标文档指令格式中的字节7, 范围0-16)", required = true)
@Parameter(name = "combindCode2", description = "组合码二(对应国标文档指令格式中的字节7, 范围0-15)", required = true)
@GetMapping("/common/{deviceId}/{channelId}")
public void frontEndCommand(@PathVariable String deviceId,@PathVariable String channelId,Integer cmdCode, Integer parameter1, Integer parameter2, Integer combindCode2){
@ -62,13 +62,13 @@ public class PtzController {
}
if (parameter1 == null || parameter1 < 0 || parameter1 > 255) {
throw new ControllerException(ErrorCode.ERROR100.getCode(), "parameter1 为 1-255的数字");
throw new ControllerException(ErrorCode.ERROR100.getCode(), "parameter1 为 0-255的数字");
}
if (parameter2 == null || parameter2 < 0 || parameter2 > 255) {
throw new ControllerException(ErrorCode.ERROR100.getCode(), "parameter1 为 1-255的数字");
throw new ControllerException(ErrorCode.ERROR100.getCode(), "parameter2 为 0-255的数字");
}
if (combindCode2 == null || combindCode2 < 0 || combindCode2 > 16) {
throw new ControllerException(ErrorCode.ERROR100.getCode(), "parameter1 为 1-255的数字");
if (combindCode2 == null || combindCode2 < 0 || combindCode2 > 15) {
throw new ControllerException(ErrorCode.ERROR100.getCode(), "combindCode2 为 0-15的数字");
}
Device device = deviceService.getDeviceByDeviceId(deviceId);
@ -84,7 +84,7 @@ public class PtzController {
@Parameter(name = "command", description = "控制指令,允许值: left, right, up, down, upleft, upright, downleft, downright, zoomin, zoomout, stop", required = true)
@Parameter(name = "horizonSpeed", description = "水平速度(0-255)", required = true)
@Parameter(name = "verticalSpeed", description = "垂直速度(0-255)", required = true)
@Parameter(name = "zoomSpeed", description = "缩放速度(0-16)", required = true)
@Parameter(name = "zoomSpeed", description = "缩放速度(0-15)", required = true)
@GetMapping("/ptz/{deviceId}/{channelId}")
public void ptz(@PathVariable String deviceId,@PathVariable String channelId, String command, Integer horizonSpeed, Integer verticalSpeed, Integer zoomSpeed){
@ -94,17 +94,17 @@ public class PtzController {
if (horizonSpeed == null) {
horizonSpeed = 100;
}else if (horizonSpeed < 0 || horizonSpeed > 255) {
throw new ControllerException(ErrorCode.ERROR100.getCode(), "horizonSpeed 为 1-255的数字");
throw new ControllerException(ErrorCode.ERROR100.getCode(), "horizonSpeed 为 0-255的数字");
}
if (verticalSpeed == null) {
verticalSpeed = 100;
}else if (verticalSpeed < 0 || verticalSpeed > 255) {
throw new ControllerException(ErrorCode.ERROR100.getCode(), "verticalSpeed 为 1-255的数字");
throw new ControllerException(ErrorCode.ERROR100.getCode(), "verticalSpeed 为 0-255的数字");
}
if (zoomSpeed == null) {
zoomSpeed = 16;
}else if (zoomSpeed < 0 || zoomSpeed > 16) {
throw new ControllerException(ErrorCode.ERROR100.getCode(), "zoomSpeed 为 1-255的数字");
}else if (zoomSpeed < 0 || zoomSpeed > 15) {
throw new ControllerException(ErrorCode.ERROR100.getCode(), "zoomSpeed 为 0-15的数字");
}
int cmdCode = 0;
@ -195,7 +195,7 @@ public class PtzController {
if (speed == null) {
speed = 100;
}else if (speed < 0 || speed > 255) {
throw new ControllerException(ErrorCode.ERROR100.getCode(), "verticalSpeed 为 1-255的数字");
throw new ControllerException(ErrorCode.ERROR100.getCode(), "speed 为 0-255的数字");
}
int cmdCode = 0x40;