修改错误的注释

This commit is contained in:
panlinlin 2021-01-06 10:01:28 +08:00
parent 3a6fc34a11
commit 80682bbe9d
2 changed files with 14 additions and 27 deletions

View File

@ -182,35 +182,24 @@ public class SIPCommander implements ISIPCommander {
/** /**
* 云台指令码计算 * 云台指令码计算
* *
* @param leftRight 镜头左移右移 0:停止 1:左移 2:右移 * @param cmdCode 指令码
* @param upDown 镜头上移下移 0:停止 1:上移 2:下移 * @param parameter1 数据1
* @param inOut 镜头放大缩小 0:停止 1:缩小 2:放大 * @param parameter2 数据2
* @param moveSpeed 镜头移动速度 默认 0XFF (0-255) * @param combineCode2 组合码2
* @param zoomSpeed 镜头缩放速度 默认 0X1 (0-255)
*/ */
public static String frontEndCmdString(int cmdCode, int parameter1, int parameter2, int combineCode2) {
/**
* 云台指令码计算
*
* @param cmdCode 指令码
* @param horizonSpeed 水平移动速度
* @param verticalSpeed 垂直移动速度
* @param zoomSpeed 缩放速度
* @return
*/
public static String frontEndCmdString(int cmdCode, int horizonSpeed, int verticalSpeed, int zoomSpeed) {
StringBuilder builder = new StringBuilder("A50F01"); StringBuilder builder = new StringBuilder("A50F01");
String strTmp; String strTmp;
strTmp = String.format("%02X", cmdCode); strTmp = String.format("%02X", cmdCode);
builder.append(strTmp, 0, 2); builder.append(strTmp, 0, 2);
strTmp = String.format("%02X", horizonSpeed); strTmp = String.format("%02X", parameter1);
builder.append(strTmp, 0, 2); builder.append(strTmp, 0, 2);
strTmp = String.format("%02X", verticalSpeed); strTmp = String.format("%02X", parameter2);
builder.append(strTmp, 0, 2); builder.append(strTmp, 0, 2);
strTmp = String.format("%X", zoomSpeed); strTmp = String.format("%X", combineCode2);
builder.append(strTmp, 0, 1).append("0"); builder.append(strTmp, 0, 1).append("0");
//计算校验码 //计算校验码
int checkCode = (0XA5 + 0X0F + 0X01 + cmdCode + horizonSpeed + verticalSpeed + (zoomSpeed & 0XF0)) % 0X100; int checkCode = (0XA5 + 0X0F + 0X01 + cmdCode + parameter1 + parameter2 + (combineCode2 & 0XF0)) % 0X100;
strTmp = String.format("%02X", checkCode); strTmp = String.format("%02X", checkCode);
builder.append(strTmp, 0, 2); builder.append(strTmp, 0, 2);
return builder.toString(); return builder.toString();
@ -259,14 +248,14 @@ public class SIPCommander implements ISIPCommander {
* @param device 控制设备 * @param device 控制设备
* @param channelId 预览通道 * @param channelId 预览通道
* @param cmdCode 指令码 * @param cmdCode 指令码
* @param horizonSpeed 水平移动速度 * @param parameter1 数据1
* @param verticalSpeed 垂直移动速度 * @param parameter2 数据2
* @param zoomSpeed 缩放速度 * @param combineCode2 组合码2
*/ */
@Override @Override
public boolean frontEndCmd(Device device, String channelId, int cmdCode, int horizonSpeed, int verticalSpeed, int zoomSpeed) { public boolean frontEndCmd(Device device, String channelId, int cmdCode, int parameter1, int parameter2, int combineCode2) {
try { try {
String cmdStr= frontEndCmdString(cmdCode, horizonSpeed, verticalSpeed, zoomSpeed); String cmdStr= frontEndCmdString(cmdCode, parameter1, parameter2, combineCode2);
System.out.println("控制字符串:" + cmdStr); System.out.println("控制字符串:" + cmdStr);
StringBuffer ptzXml = new StringBuffer(200); StringBuffer ptzXml = new StringBuffer(200);
ptzXml.append("<?xml version=\"1.0\" ?>\r\n"); ptzXml.append("<?xml version=\"1.0\" ?>\r\n");

View File

@ -102,8 +102,6 @@ public class VideoManagerStoragerImpl implements IVideoManagerStorager {
return new PageInfo<>(all); return new PageInfo<>(all);
} }
@Override @Override
public List<DeviceChannel> queryChannelsByDeviceId(String deviceId) { public List<DeviceChannel> queryChannelsByDeviceId(String deviceId) {
return deviceChannelMapper.queryChannelsByDeviceId(deviceId, null,null, null, null); return deviceChannelMapper.queryChannelsByDeviceId(deviceId, null,null, null, null);