From e5cf57c6797b3881be2b904b75e02123fb97c860 Mon Sep 17 00:00:00 2001 From: shijianquan <992593080@qq.com> Date: Thu, 15 May 2025 15:14:00 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=E4=BF=AE=E6=94=B9=E8=A7=86=E9=A2=91?= =?UTF-8?q?=E6=8E=A7=E4=BB=B6=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugin/IpcWallWidget/IpcWallWidget.pro | 3 +- .../gui/plugin/IpcWallWidget/VideoWall.cpp | 51 +++++++++++++++++++ 2 files changed, 53 insertions(+), 1 deletion(-) diff --git a/product/src/gui/plugin/IpcWallWidget/IpcWallWidget.pro b/product/src/gui/plugin/IpcWallWidget/IpcWallWidget.pro index 5e554c77..b4c0e48f 100644 --- a/product/src/gui/plugin/IpcWallWidget/IpcWallWidget.pro +++ b/product/src/gui/plugin/IpcWallWidget/IpcWallWidget.pro @@ -33,7 +33,8 @@ DEFINES += QT_DEPRECATED_WARNINGS #DEFINES += IPCVIEWERWIDGET_LIBRARY -SOURCES += main.cpp VideoWall.cpp \ +SOURCES += main.cpp \ + VideoWall.cpp \ ../../../../../platform/src/include/service/operate_server_api/JsonOptCommand.cpp \ $$PWD/../IpcPlusWidget/VoiceSlider.cpp \ $$PWD/../IpcViewerWidget/ccaminfo.cpp \ diff --git a/product/src/gui/plugin/IpcWallWidget/VideoWall.cpp b/product/src/gui/plugin/IpcWallWidget/VideoWall.cpp index 90f2ef54..ca18ff34 100644 --- a/product/src/gui/plugin/IpcWallWidget/VideoWall.cpp +++ b/product/src/gui/plugin/IpcWallWidget/VideoWall.cpp @@ -607,6 +607,12 @@ void VideoWall::loadPtzCtrl() if(curNo == -1) return; + if(players.size() <= curNo + || m_camInfoVec.size() <= curNo) + { + return; + } + if(players[curNo]->isPlaying()) { m_play->setHidden(true); @@ -1050,6 +1056,11 @@ bool VideoWall::sendOptGotopreset(const std::string &preset_tag) void VideoWall::leftPressed() { + if(curNo < 0) + { + return; + } + if(!players[curNo]->isPlaying()) return; if(ptzContinuousMove(PTZ_LEFT,1) == false) @@ -1060,6 +1071,11 @@ void VideoWall::leftPressed() void VideoWall::rightPressed() { + if(curNo < 0) + { + return; + } + if(!players[curNo]->isPlaying()) return; if(ptzContinuousMove(PTZ_RIGHT,1) == false) @@ -1071,6 +1087,11 @@ void VideoWall::rightPressed() void VideoWall::upPressed() { + if(curNo < 0) + { + return; + } + if(!players[curNo]->isPlaying()) return; if(ptzContinuousMove(PTZ_UP,1) == false) @@ -1081,6 +1102,11 @@ void VideoWall::upPressed() void VideoWall::downPressed() { + if(curNo < 0) + { + return; + } + if(!players[curNo]->isPlaying()) return; if(ptzContinuousMove(PTZ_DOWN,1) == false) @@ -1091,6 +1117,11 @@ void VideoWall::downPressed() void VideoWall::tretchPressed() { + if(curNo < 0) + { + return; + } + if(!players[curNo]->isPlaying()) return; if(ptzContinuousMove(PTZ_ZOOMIN,1) == false) @@ -1101,6 +1132,11 @@ void VideoWall::tretchPressed() void VideoWall::drawPressed() { + if(curNo < 0) + { + return; + } + if(!players[curNo]->isPlaying()) return; if(ptzContinuousMove(PTZ_ZOOMOUT,1) == false) @@ -1111,6 +1147,11 @@ void VideoWall::drawPressed() void VideoWall::released() { + if(curNo < 0) + { + return; + } + if(!players[curNo]->isPlaying()) return; if(ptzStopMove() == false) @@ -1119,6 +1160,11 @@ void VideoWall::released() void VideoWall::gotoPreset() { + if(curNo < 0) + { + return; + } + if(!players[curNo]->isPlaying()) return; else @@ -1133,6 +1179,11 @@ void VideoWall::gotoPreset() void VideoWall::capture() { + if(curNo < 0) + { + return; + } + if (players[curNo]->isPlaying()) { players[curNo]->videoCapture()->setCaptureName(QDateTime::currentDateTime().toString("yyyy_MMdd_hhmmss_z")); players[curNo]->videoCapture()->capture();