












要说逆不逆天,这套监控系统绝对算得上是行业里的“天花板”级别。它支持高达500路监控画面同时接入,无论是大型园区、交通枢纽还是复杂厂区,都能轻松应对海量摄像头的集中管理。强大的处理能力和稳定的网络架构,确保每一帧画面都流畅清晰,真正做到无延迟、不卡顿,让大规模监控不再是负担。
系统还支持多屏幕同时显示,用户可根据实际需求自由组合画面布局,实现跨屏联动监控。无论是指挥中心的大屏拼接墙,还是办公室内的多台显示器,都能轻松实现统一调度、实时预览与回放。通过直观的操作界面,管理人员可一键切换重点区域画面,快速响应突发事件,大幅提升监控效率与安全性,真正做到了智能化、可视化的高效管理。

#include "frmvideoscreen.h"
#include "ui_frmvideoscreen.h"
#include "qthelper.h"
#include "videobox.h"
#include "videowidgetx.h"
#include "deviceutil.h"
#include "devicetree.h"
#include "deviceicon.h"
int frmVideoScreen::count = 0;
QStringList frmVideoScreen::indexs = QString("0|1|2|3").split("|");
frmVideoScreen::frmVideoScreen(QWidget *parent) : QWidget(parent), ui(new Ui::frmVideoScreen)
{
ui->setupUi(this);
this->initForm();
this->initIcon();
this->initVideo();
QtHelper::setFormInCenter(this);
}
frmVideoScreen::~frmVideoScreen()
{
delete ui;
}
void frmVideoScreen::closeEvent(QCloseEvent *)
{
//计数减少
count--;
//更新索引
int index = this->property("index").toInt();
indexs[index] = QString::number(index);
//关闭所有视频并释放对象
foreach (VideoWidget *videoWidget, videoWidgets) {
videoWidget->setParent(NULL);
videoWidget->stop();
}
}
void frmVideoScreen::initForm()
{
//计数增加
count++;
//取出索引
int index;
foreach (QString name, indexs) {
if (!name.isEmpty()) {
//用掉一个索引就置空
index = name.toInt();
indexs[index] = "";
break;
}
}
ui->frame->setFixedWidth(AppData::RightWidth);
this->setAttribute(Qt::WA_DeleteOnClose);
this->setProperty("index", index);
this->setWindowTitle(QString("辅屏预览 %1").arg(index + 1));
connect(AppEvent::Instance(), SIGNAL(changeStyle()), this, SLOT(initIcon()));
DeviceTree::initTree(ui->treeWidget);
DeviceTree::initTreeParent(ui->treeWidget);
DeviceTree::initTreeChild(ui->treeWidget);
DeviceTree::hideTreeChild(ui->treeWidget);
DeviceTree::initExpandItem(ui->treeWidget);
}
void frmVideoScreen::initIcon()
{
DeviceIcon::initTreeIcon(ui->treeWidget, false);
}
void frmVideoScreen::initVideo()
{
videoSelect = NULL;
videoWidgets.clear();
//实例化视频控件
QWidgetList widgets;
for (int i = 0; i < AppConfig::VideoCount; ++i) {
VideoWidget *videoWidget = new VideoWidget;
connect(videoWidget, SIGNAL(sig_fileDrag(QString)), this, SLOT(fileDrag(QString)));
DeviceUtil::initVideoWidget2(videoWidget);
videoWidget->hideButton();
videoWidget->setBgText(QString("通道 %1").arg(i + 1, 2, 10, QChar('0')));
widgets << videoWidget;
videoWidgets << videoWidget;
}
//实例化右键菜单
videoMenu = new QMenu(this);
videoSelect = videoWidgets.first();
//实例化通道布局类
videoBox = new VideoBox(this);
connect(videoBox, SIGNAL(widgetSelected(QWidget *)), this, SLOT(widgetSelected(QWidget *)));
connect(videoBox, SIGNAL(layoutChanged(int, QString, bool)), this, SLOT(layoutChanged(int, QString, bool)));
videoBox->setLayout(ui->gridLayout);
videoBox->initMenu(videoMenu);
videoBox->setWidgets(widgets, widgets);
videoBox->show_all();
}
void frmVideoScreen::fileDrag(const QString &url)
{
VideoWidget *videoWidget = (VideoWidget *)sender();
videoWidget->open(url);
}
void frmVideoScreen::on_treeWidget_itemDoubleClicked(QTreeWidgetItem *item, int)
{
QString url = item->data(0, Qt::UserRole).toString();
if (DeviceTree::isUrl(url)) {
//最后按下的哪个控件加载
if (!videoSelect) {
return;
}
//打开视频并自动移动到下一个
videoSelect->open(url);
int index = videoWidgets.indexOf(videoSelect);
VideoWidget *videoWidget = videoWidgets.at(index + 1);
videoWidget->setFocus();
videoSelect = videoWidget;
} else {
//关闭所有视频
foreach (VideoWidget *videoWidget, videoWidgets) {
videoWidget->stop();
}
//逐个打开/直到全部打开完成
QStringList urls = DeviceTree::getUrls(item);
int count = qMin(videoWidgets.count(), urls.count());
for (int i = 0; i < count; ++i) {
videoWidgets.at(i)->open(urls.at(i));
//如果电脑性能好可以不延时/不延迟可能会崩溃
//QtHelper::sleep(AppConfig::OpenInterval, false);
}
}
}
void frmVideoScreen::widgetSelected(QWidget *widget)
{
videoSelect = (VideoWidget *)widget;
}
void frmVideoScreen::layoutChanged(int type, const QString &layoutType, bool isMax)
{
}
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。