Dgq
dusky
2025-07-28 dcb3a2c9ca93ed20aa64eef08d0dfdf320a42ac0
Dgq
4个文件已修改
11个文件已添加
268 ■■■■ 已修改文件
Server/杜国庆/code/BG_Mon_Subsystem/BG_Mon_Subsystem.pro 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Server/杜国庆/code/BG_Mon_Subsystem/BG_Mon_Subsystem.pro.user 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Server/杜国庆/code/BG_Mon_Subsystem/databasemanager.cpp 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Server/杜国庆/code/BG_Mon_Subsystem/databasemanager.h 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Server/杜国庆/code/BG_Mon_Subsystem/gb_mon_subsystem_mainwindow.h 29 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Server/杜国庆/code/BG_Mon_Subsystem/gb_mon_subsystem_mainwindow.ui 73 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Server/杜国庆/code/BG_Mon_Subsystem/performancechart.cpp 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Server/杜国庆/code/BG_Mon_Subsystem/performancechart.h 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Server/杜国庆/code/BG_Mon_Subsystem/systemdaemon.cpp 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Server/杜国庆/code/BG_Mon_Subsystem/systemdaemon.h 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Server/杜国庆/code/BG_Mon_Subsystem/systemmonitor.cpp 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Server/杜国庆/code/BG_Mon_Subsystem/systemmonitor.h 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Server/杜国庆/code/BG_Mon_Subsystem/videostoragemanager.cpp 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Server/杜国庆/code/BG_Mon_Subsystem/videostoragemanager.h 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Server/杜国庆/log/日志_Dgq_250726 .docx 补丁 | 查看 | 原始文档 | blame | 历史
Server/¶Å¹úÇì/code/BG_Mon_Subsystem/BG_Mon_Subsystem.pro
@@ -25,10 +25,20 @@
SOURCES += \
        main.cpp \
        gb_mon_subsystem_mainwindow.cpp
        gb_mon_subsystem_mainwindow.cpp \
    videostoragemanager.cpp \
    systemdaemon.cpp \
    systemmonitor.cpp \
    performancechart.cpp \
    databasemanager.cpp
HEADERS += \
        gb_mon_subsystem_mainwindow.h
        gb_mon_subsystem_mainwindow.h \
    videostoragemanager.h \
    systemdaemon.h \
    systemmonitor.h \
    performancechart.h \
    databasemanager.h
FORMS += \
        gb_mon_subsystem_mainwindow.ui
Server/¶Å¹úÇì/code/BG_Mon_Subsystem/BG_Mon_Subsystem.pro.user
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.5.0, 2025-07-24T15:02:24. -->
<!-- Written by QtCreator 4.5.0, 2025-07-25T18:29:49. -->
<qtcreator>
 <data>
  <variable>EnvironmentId</variable>
Server/¶Å¹úÇì/code/BG_Mon_Subsystem/databasemanager.cpp
New file
@@ -0,0 +1,6 @@
#include "databasemanager.h"
DatabaseManager::DatabaseManager()
{
}
Server/¶Å¹úÇì/code/BG_Mon_Subsystem/databasemanager.h
New file
@@ -0,0 +1,23 @@
#ifndef DATABASEMANAGER_H
#define DATABASEMANAGER_H
class DatabaseManager {
public:
    static DatabaseManager& instance();
    bool logEvent(const QString &eventType, const QString &description,
                 const QString &cameraId = QString());
    bool storePerformanceData(double cpuUsage, double memoryUsage);
    QVector<EventRecord> queryEvents(const QDateTime &from,
                                    const QDateTime &to,
                                    const QString &cameraId = QString());
private:
    DatabaseManager();
    QSqlDatabase m_db;
};
#endif // DATABASEMANAGER_H
Server/¶Å¹úÇì/code/BG_Mon_Subsystem/gb_mon_subsystem_mainwindow.h
@@ -2,21 +2,40 @@
#define GB_MON_SUBSYSTEM_MAINWINDOW_H
#include <QMainWindow>
#include <VideoStorageManager>
#include <SystemMonitor>
#include <PerformanceChart>
#include <AlertProcessor>
#include <QThread>
namespace Ui {
class GB_Mon_Subsystem_MainWindow;
}
class GB_Mon_Subsystem_MainWindow : public QMainWindow
{
class GB_Mon_Subsystem_MainWindow : public QMainWindow {
    Q_OBJECT
public:
    explicit GB_Mon_Subsystem_MainWindow(QWidget *parent = 0);
    GB_Mon_Subsystem_MainWindow(QWidget *parent = nullptr);
    ~GB_Mon_Subsystem_MainWindow();
private slots:
    void updatePerformanceCharts();
    void handleNewAlert(const Alert &alert);
    void handleDatabaseError(const QString &error);
private:
    Ui::GB_Mon_Subsystem_MainWindow *ui;
    void setupThreads();
    void setupConnections();
    VideoStorageManager *m_videoManager;
    SystemMonitor *m_systemMonitor;
    PerformanceChart *m_performanceChart;
    AlertProcessor *m_alertProcessor;
    QThread *m_storageThread;
    QThread *m_monitorThread;
};
#endif // GB_MON_SUBSYSTEM_MAINWINDOW_H
Server/¶Å¹úÇì/code/BG_Mon_Subsystem/gb_mon_subsystem_mainwindow.ui
@@ -6,81 +6,14 @@
   <rect>
    <x>0</x>
    <y>0</y>
    <width>1001</width>
    <height>585</height>
    <width>1086</width>
    <height>752</height>
   </rect>
  </property>
  <property name="windowTitle">
   <string>GB_Mon_Subsystem_MainWindow</string>
  </property>
  <widget class="QWidget" name="centralWidget">
   <widget class="QPushButton" name="pushButton">
    <property name="geometry">
     <rect>
      <x>150</x>
      <y>310</y>
      <width>93</width>
      <height>28</height>
     </rect>
    </property>
    <property name="text">
     <string>PushButton</string>
    </property>
   </widget>
   <widget class="QPushButton" name="pushButton_2">
    <property name="geometry">
     <rect>
      <x>640</x>
      <y>310</y>
      <width>93</width>
      <height>28</height>
     </rect>
    </property>
    <property name="text">
     <string>PushButton</string>
    </property>
   </widget>
   <widget class="QTableWidget" name="tableWidget">
    <property name="geometry">
     <rect>
      <x>150</x>
      <y>60</y>
      <width>581</width>
      <height>211</height>
     </rect>
    </property>
    <row>
     <property name="text">
      <string>新建行</string>
     </property>
    </row>
    <row>
     <property name="text">
      <string>新建行</string>
     </property>
    </row>
    <row>
     <property name="text">
      <string>新建行</string>
     </property>
    </row>
    <column>
     <property name="text">
      <string>磁盘读入</string>
     </property>
    </column>
    <column>
     <property name="text">
      <string>磁盘写</string>
     </property>
    </column>
    <column>
     <property name="text">
      <string>cpu使用率</string>
     </property>
    </column>
   </widget>
  </widget>
  <widget class="QWidget" name="centralWidget"/>
 </widget>
 <layoutdefault spacing="6" margin="11"/>
 <resources/>
Server/¶Å¹úÇì/code/BG_Mon_Subsystem/performancechart.cpp
New file
@@ -0,0 +1,6 @@
#include "performancechart.h"
PerformanceChart::PerformanceChart()
{
}
Server/¶Å¹úÇì/code/BG_Mon_Subsystem/performancechart.h
New file
@@ -0,0 +1,29 @@
#ifndef PERFORMANCECHART_H
#define PERFORMANCECHART_H
class MonitoringSystem : public QMainWindow {
    Q_OBJECT
public:
    MonitoringSystem(QWidget *parent = nullptr);
    ~MonitoringSystem();
private slots:
    void updatePerformanceCharts();
    void handleNewAlert(const Alert &alert);
    void handleDatabaseError(const QString &error);
private:
    void setupThreads();
    void setupConnections();
    VideoStorageManager *m_videoManager;
    SystemMonitor *m_systemMonitor;
    PerformanceChart *m_performanceChart;
    AlertProcessor *m_alertProcessor;
    QThread *m_storageThread;
    QThread *m_monitorThread;
};
#endif // PERFORMANCECHART_H
Server/¶Å¹úÇì/code/BG_Mon_Subsystem/systemdaemon.cpp
New file
@@ -0,0 +1,6 @@
#include "systemdaemon.h"
SystemDaemon::SystemDaemon(QObject *parent) : QObject(parent)
{
}
Server/¶Å¹úÇì/code/BG_Mon_Subsystem/systemdaemon.h
New file
@@ -0,0 +1,23 @@
#ifndef SYSTEMDAEMON_H
#define SYSTEMDAEMON_H
#include <QObject>
class SystemMonitor : public QObject {
    Q_OBJECT
public:
    SystemMonitor(QObject *parent = nullptr);
    double currentCpuUsage() const;
    double memoryUsage() const;
signals:
    void systemStatsUpdated(double cpuUsage, double memoryUsage);
private:
    QTimer *m_monitorTimer;
    qint64 m_lastCpuIdle;
    qint64 m_lastCpuTotal;
};
#endif // SYSTEMDAEMON_H
Server/¶Å¹úÇì/code/BG_Mon_Subsystem/systemmonitor.cpp
New file
@@ -0,0 +1,6 @@
#include "systemmonitor.h"
SystemMonitor::SystemMonitor(QObject *parent) : QObject(parent)
{
}
Server/¶Å¹úÇì/code/BG_Mon_Subsystem/systemmonitor.h
New file
@@ -0,0 +1,17 @@
#ifndef SYSTEMMONITOR_H
#define SYSTEMMONITOR_H
#include <QObject>
class SystemMonitor : public QObject
{
    Q_OBJECT
public:
    explicit SystemMonitor(QObject *parent = nullptr);
signals:
public slots:
};
#endif // SYSTEMMONITOR_H
Server/¶Å¹úÇì/code/BG_Mon_Subsystem/videostoragemanager.cpp
New file
@@ -0,0 +1,6 @@
#include "videostoragemanager.h"
VideoStorageManager::VideoStorageManager(QObject *parent) : QObject(parent)
{
}
Server/¶Å¹úÇì/code/BG_Mon_Subsystem/videostoragemanager.h
New file
@@ -0,0 +1,28 @@
#ifndef VIDEOSTORAGEMANAGER_H
#define VIDEOSTORAGEMANAGER_H
#include <QObject>
class VideoStorageManager : public QObject {
    Q_OBJECT
public:
    explicit VideoStorageManager(QObject *parent = nullptr);
    // å­˜å‚¨è§†é¢‘片段
    bool storeVideo(const QString &cameraId, const QByteArray &videoData,
                   const QDateTime &timestamp);
    // æ£€ç´¢è§†é¢‘片段
    QByteArray retrieveVideo(const QString &cameraId,
                            const QDateTime &startTime,
                            const QDateTime &endTime);
    // è§†é¢‘文件清理策略
    void applyRetentionPolicy(int maxDays);
private:
    QString m_storagePath;
    QMutex m_mutex;
};
#endif // VIDEOSTORAGEMANAGER_H
Server/¶Å¹úÇì/log/ÈÕÖ¾_Dgq_250726 .docx
Binary files differ