From 29d69267f9747f268a967a039f685da7e85da3a8 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Mon, 17 Jan 2022 10:16:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=80=9A=E9=81=93=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E9=A1=B5=E9=9D=A2=E6=A0=B7=E5=BC=8F=E5=92=8C=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E6=8B=89=E6=A1=86=E6=94=BE=E5=A4=A7=E4=B8=8E=E7=BC=A9?= =?UTF-8?q?=E5=B0=8F=E7=9A=84=E6=8E=A5=E5=8F=A3=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gb28181/device/DeviceControl.java | 99 +++++++++++++ .../gb28181/dragZoom/DragZoomControl.java | 138 ------------------ .../src/components/dialog/chooseChannel.vue | 3 +- .../components/dialog/chooseChannelForGb.vue | 2 +- .../src/components/dialog/importChannel.vue | 2 +- 5 files changed, 103 insertions(+), 141 deletions(-) delete mode 100644 src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/dragZoom/DragZoomControl.java diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceControl.java b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceControl.java index 20aa9576..183561ae 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceControl.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceControl.java @@ -296,4 +296,103 @@ public class DeviceControl { resultHolder.put(key, uuid, result); return result; } + + /** + * 拉框放大 + * @param deviceId 设备id + * @param channelId 通道id + * @param length 播放窗口长度像素值 + * @param width 播放窗口宽度像素值 + * @param midpointx 拉框中心的横轴坐标像素值 + * @param midpointy 拉框中心的纵轴坐标像素值 + * @param lengthx 拉框长度像素值 + * @param lengthy 拉框宽度像素值 + * @return + */ + @ApiOperation("拉框放大") + @ApiImplicitParams({ + @ApiImplicitParam(name = "deviceId", value = "设备ID", required = true, dataTypeClass = String.class), + @ApiImplicitParam(name = "channelId", value = "通道ID", dataTypeClass = String.class), + @ApiImplicitParam(name = "length", value = "播放窗口长度像素值", required = true, dataTypeClass = Integer.class), + @ApiImplicitParam(name = "width", value = "播放窗口宽度像素值", required = true, dataTypeClass = Integer.class), + @ApiImplicitParam(name = "midpointx", value = "拉框中心的横轴坐标像素值", required = true, dataTypeClass = Integer.class), + @ApiImplicitParam(name = "midpointy", value = "拉框中心的纵轴坐标像素值", required = true, dataTypeClass = Integer.class), + @ApiImplicitParam(name = "lengthx", value = "拉框长度像素值", required = true, dataTypeClass = Integer.class), + @ApiImplicitParam(name = "lengthy", value = "拉框宽度像素值", required = true, dataTypeClass = Integer.class), + }) + @GetMapping("drag_zoom/zoom_in") + public ResponseEntity dragZoomIn(@RequestParam String deviceId, + @RequestParam(required = false) String channelId, + @RequestParam int length, + @RequestParam int width, + @RequestParam int midpointx, + @RequestParam int midpointy, + @RequestParam int lengthx, + @RequestParam int lengthy){ + if (logger.isDebugEnabled()) { + logger.debug(String.format("设备拉框放大 API调用,deviceId:%s ,channelId:%s ,length:%d ,width:%d ,midpointx:%d ,midpointy:%d ,lengthx:%d ,lengthy:%d",deviceId, channelId, length, width, midpointx, midpointy,lengthx, lengthy)); + } + Device device = storager.queryVideoDevice(deviceId); + StringBuffer cmdXml = new StringBuffer(200); + cmdXml.append("\r\n"); + cmdXml.append("" + length+ "\r\n"); + cmdXml.append("" + width+ "\r\n"); + cmdXml.append("" + midpointx+ "\r\n"); + cmdXml.append("" + midpointy+ "\r\n"); + cmdXml.append("" + lengthx+ "\r\n"); + cmdXml.append("" + lengthy+ "\r\n"); + cmdXml.append("\r\n"); + cmder.dragZoomCmd(device, channelId, cmdXml.toString()); + return new ResponseEntity("success", HttpStatus.OK); + } + + /** + * 拉框缩小 + * @param deviceId 设备id + * @param channelId 通道id + * @param length 播放窗口长度像素值 + * @param width 播放窗口宽度像素值 + * @param midpointx 拉框中心的横轴坐标像素值 + * @param midpointy 拉框中心的纵轴坐标像素值 + * @param lengthx 拉框长度像素值 + * @param lengthy 拉框宽度像素值 + * @return + */ + @ApiOperation("拉框缩小") + @ApiImplicitParams({ + @ApiImplicitParam(name = "deviceId", value = "设备ID", required = true, dataTypeClass = String.class), + @ApiImplicitParam(name = "channelId", value = "通道ID", dataTypeClass = String.class), + @ApiImplicitParam(name = "length", value = "播放窗口长度像素值", required = true, dataTypeClass = Integer.class), + @ApiImplicitParam(name = "width", value = "播放窗口宽度像素值", required = true, dataTypeClass = Integer.class), + @ApiImplicitParam(name = "midpointx", value = "拉框中心的横轴坐标像素值", required = true, dataTypeClass = Integer.class), + @ApiImplicitParam(name = "midpointy", value = "拉框中心的纵轴坐标像素值", required = true, dataTypeClass = Integer.class), + @ApiImplicitParam(name = "lengthx", value = "拉框长度像素值", required = true, dataTypeClass = Integer.class), + @ApiImplicitParam(name = "lengthy", value = "拉框宽度像素值", required = true, dataTypeClass = Integer.class), + }) + @GetMapping("/drag_zoom/zoom_out") + public ResponseEntity dragZoomOut(@RequestParam String deviceId, + @RequestParam(required = false) String channelId, + @RequestParam int length, + @RequestParam int width, + @RequestParam int midpointx, + @RequestParam int midpointy, + @RequestParam int lengthx, + @RequestParam int lengthy){ + + if (logger.isDebugEnabled()) { + logger.debug(String.format("设备拉框缩小 API调用,deviceId:%s ,channelId:%s ,length:%d ,width:%d ,midpointx:%d ,midpointy:%d ,lengthx:%d ,lengthy:%d",deviceId, channelId, length, width, midpointx, midpointy,lengthx, lengthy)); + } + Device device = storager.queryVideoDevice(deviceId); + StringBuffer cmdXml = new StringBuffer(200); + cmdXml.append("\r\n"); + cmdXml.append("" + length+ "\r\n"); + cmdXml.append("" + width+ "\r\n"); + cmdXml.append("" + midpointx+ "\r\n"); + cmdXml.append("" + midpointy+ "\r\n"); + cmdXml.append("" + lengthx+ "\r\n"); + cmdXml.append("" + lengthy+ "\r\n"); + cmdXml.append("\r\n"); + cmder.dragZoomCmd(device, channelId, cmdXml.toString()); + return new ResponseEntity("success",HttpStatus.OK); + } } diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/dragZoom/DragZoomControl.java b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/dragZoom/DragZoomControl.java deleted file mode 100644 index fb1970ef..00000000 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/dragZoom/DragZoomControl.java +++ /dev/null @@ -1,138 +0,0 @@ -package com.genersoft.iot.vmp.vmanager.gb28181.dragZoom; - -import com.genersoft.iot.vmp.gb28181.bean.Device; -import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; -import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander; -import com.genersoft.iot.vmp.storager.IVideoManagerStorager; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.*; - -/** - * @author szy - * @date 21:55 2022/1/15 - */ -@Api(tags = "拉框控制") -@CrossOrigin -@RestController -@RequestMapping("/api/dragZoom") -public class DragZoomControl { - - private final static Logger logger = LoggerFactory.getLogger(DragZoomControl.class); - - @Autowired - private SIPCommander cmder; - - @Autowired - private IVideoManagerStorager storager; - - @Autowired - private DeferredResultHolder resultHolder; - - /** - * 拉框放大 - * @param deviceId 设备id - * @param channelId 通道id - * @param length 播放窗口长度像素值 - * @param width 播放窗口宽度像素值 - * @param midpointx 拉框中心的横轴坐标像素值 - * @param midpointy 拉框中心的纵轴坐标像素值 - * @param lengthx 拉框长度像素值 - * @param lengthy 拉框宽度像素值 - * @return - */ - @ApiOperation("拉框放大") - @ApiImplicitParams({ - @ApiImplicitParam(name = "deviceId", value = "设备ID", required = true, dataTypeClass = String.class), - @ApiImplicitParam(name = "channelId", value = "通道ID", dataTypeClass = String.class), - @ApiImplicitParam(name = "length", value = "播放窗口长度像素值", required = true, dataTypeClass = Integer.class), - @ApiImplicitParam(name = "width", value = "播放窗口宽度像素值", required = true, dataTypeClass = Integer.class), - @ApiImplicitParam(name = "midpointx", value = "拉框中心的横轴坐标像素值", required = true, dataTypeClass = Integer.class), - @ApiImplicitParam(name = "midpointy", value = "拉框中心的纵轴坐标像素值", required = true, dataTypeClass = Integer.class), - @ApiImplicitParam(name = "lengthx", value = "拉框长度像素值", required = true, dataTypeClass = Integer.class), - @ApiImplicitParam(name = "lengthy", value = "拉框宽度像素值", required = true, dataTypeClass = Integer.class), - }) - @GetMapping("/dragzoomin") - public ResponseEntity dragZoomIn(@RequestParam String deviceId, - @RequestParam(required = false) String channelId, - @RequestParam int length, - @RequestParam int width, - @RequestParam int midpointx, - @RequestParam int midpointy, - @RequestParam int lengthx, - @RequestParam int lengthy){ - if (logger.isDebugEnabled()) { - logger.debug(String.format("设备拉框放大 API调用,deviceId:%s ,channelId:%s ,length:%d ,width:%d ,midpointx:%d ,midpointy:%d ,lengthx:%d ,lengthy:%d",deviceId, channelId, length, width, midpointx, midpointy,lengthx, lengthy)); - } - Device device = storager.queryVideoDevice(deviceId); - StringBuffer cmdXml = new StringBuffer(200); - cmdXml.append("\r\n"); - cmdXml.append("" + length+ "\r\n"); - cmdXml.append("" + width+ "\r\n"); - cmdXml.append("" + midpointx+ "\r\n"); - cmdXml.append("" + midpointy+ "\r\n"); - cmdXml.append("" + lengthx+ "\r\n"); - cmdXml.append("" + lengthy+ "\r\n"); - cmdXml.append("\r\n"); - cmder.dragZoomCmd(device, channelId, cmdXml.toString()); - return new ResponseEntity("success", HttpStatus.OK); - } - - /** - * 拉框缩小 - * @param deviceId 设备id - * @param channelId 通道id - * @param length 播放窗口长度像素值 - * @param width 播放窗口宽度像素值 - * @param midpointx 拉框中心的横轴坐标像素值 - * @param midpointy 拉框中心的纵轴坐标像素值 - * @param lengthx 拉框长度像素值 - * @param lengthy 拉框宽度像素值 - * @return - */ - @ApiOperation("拉框缩小") - @ApiImplicitParams({ - @ApiImplicitParam(name = "deviceId", value = "设备ID", required = true, dataTypeClass = String.class), - @ApiImplicitParam(name = "channelId", value = "通道ID", dataTypeClass = String.class), - @ApiImplicitParam(name = "length", value = "播放窗口长度像素值", required = true, dataTypeClass = Integer.class), - @ApiImplicitParam(name = "width", value = "播放窗口宽度像素值", required = true, dataTypeClass = Integer.class), - @ApiImplicitParam(name = "midpointx", value = "拉框中心的横轴坐标像素值", required = true, dataTypeClass = Integer.class), - @ApiImplicitParam(name = "midpointy", value = "拉框中心的纵轴坐标像素值", required = true, dataTypeClass = Integer.class), - @ApiImplicitParam(name = "lengthx", value = "拉框长度像素值", required = true, dataTypeClass = Integer.class), - @ApiImplicitParam(name = "lengthy", value = "拉框宽度像素值", required = true, dataTypeClass = Integer.class), - }) - @GetMapping("/dragzoomout") - public ResponseEntity dragZoomOut(@RequestParam String deviceId, - @RequestParam(required = false) String channelId, - @RequestParam int length, - @RequestParam int width, - @RequestParam int midpointx, - @RequestParam int midpointy, - @RequestParam int lengthx, - @RequestParam int lengthy){ - - if (logger.isDebugEnabled()) { - logger.debug(String.format("设备拉框缩小 API调用,deviceId:%s ,channelId:%s ,length:%d ,width:%d ,midpointx:%d ,midpointy:%d ,lengthx:%d ,lengthy:%d",deviceId, channelId, length, width, midpointx, midpointy,lengthx, lengthy)); - } - Device device = storager.queryVideoDevice(deviceId); - StringBuffer cmdXml = new StringBuffer(200); - cmdXml.append("\r\n"); - cmdXml.append("" + length+ "\r\n"); - cmdXml.append("" + width+ "\r\n"); - cmdXml.append("" + midpointx+ "\r\n"); - cmdXml.append("" + midpointy+ "\r\n"); - cmdXml.append("" + lengthx+ "\r\n"); - cmdXml.append("" + lengthy+ "\r\n"); - cmdXml.append("\r\n"); - cmder.dragZoomCmd(device, channelId, cmdXml.toString()); - return new ResponseEntity("success",HttpStatus.OK); - } - -} diff --git a/web_src/src/components/dialog/chooseChannel.vue b/web_src/src/components/dialog/chooseChannel.vue index cc810c93..5544b383 100644 --- a/web_src/src/components/dialog/chooseChannel.vue +++ b/web_src/src/components/dialog/chooseChannel.vue @@ -70,7 +70,8 @@ export default { platformName: "", defaultCatalogId: "", showDialog: false, - chooseData: {} + chooseData: {}, + winHeight: window.innerHeight - 250, }; }, diff --git a/web_src/src/components/dialog/chooseChannelForGb.vue b/web_src/src/components/dialog/chooseChannelForGb.vue index b8a7a0ce..742b3de5 100644 --- a/web_src/src/components/dialog/chooseChannelForGb.vue +++ b/web_src/src/components/dialog/chooseChannelForGb.vue @@ -75,7 +75,7 @@ export default { count: 10, total: 0, eventEnanle: false, - winHeight: window.innerHeight - 350, + winHeight: window.innerHeight - 400, }; }, diff --git a/web_src/src/components/dialog/importChannel.vue b/web_src/src/components/dialog/importChannel.vue index efd0893b..ac5ce05d 100644 --- a/web_src/src/components/dialog/importChannel.vue +++ b/web_src/src/components/dialog/importChannel.vue @@ -38,7 +38,7 @@ export default { showDialog: false, isLoging: false, isEdit: false, - uploadUrl: "debug/api/push/upload", + uploadUrl: process.env.NODE_ENV === 'development'?`debug/api/push/upload`:`api/push/upload`, }; }, methods: {