Parcourir la source

V0.2.3
1、完成了对比项设置的部分功能

Apple il y a 3 semaines
Parent
commit
664eca250f

+ 13 - 0
SQL/ACASetting.sql

@@ -0,0 +1,13 @@
+-- Active: 1751960213665@@192.1.2.61@5236@EQM_CESHI
+
+
+
+
+#对比项表
+SELECT *
+FROM tACACompareItem;
+
+#声卡通道表
+SELECT *
+FROM tACARoad;
+

+ 42 - 0
SettingLibrary/DataBase/GlobalVariable.cpp

@@ -0,0 +1,42 @@
+#include "GlobalVariable.h"
+
+
+/* ====================================================================
+ * CompareItemInfo_t对比项结构体
+ * ==================================================================== */
+
+CompareItemDetectParam_t& CompareItemDetectParam_t::operator=(const CompareItemDetectParam_t &other)
+{
+    if(this == &other)
+    {
+        return *this;
+    }
+    isEnable = other.isEnable;
+    threshold = other.threshold;
+    nLen = other.nLen;
+    nSensibility = other.nSensibility;
+    return *this;
+}
+
+
+
+CompareItemInfo_t::CompareItemInfo_t(const CompareItemInfo_t &other)
+{
+    *this = other;
+}
+
+CompareItemInfo_t& CompareItemInfo_t::operator=(const CompareItemInfo_t &other)
+{
+    if(this == &other)
+    {
+        return *this;
+    }
+    nID = other.nID;
+    strName = other.strName;
+    isEnable = other.isEnable;
+    listChannels = other.listChannels;
+    muteParam = other.muteParam;
+    overloadParam = other.overloadParam;
+    phaseParam = other.phaseParam;
+    return *this;
+}

+ 100 - 0
SettingLibrary/DataBase/GlobalVariable.h

@@ -0,0 +1,100 @@
+#ifndef __GLOBAL_VARIABLE_H__
+#define __GLOBAL_VARIABLE_H__
+
+
+#include <QString>
+#include <QList>
+
+
+
+/**
+ * @brief 对比项信息在表格中的显示结构体
+ * 
+ */
+struct CompareItemTableItem_t
+{
+    int nSerialNum;             /* 序号 */
+    int nID;                    /* 对比项ID */
+    QString strName;            /* 对比项名称 */
+    bool isEnable;              /* 对比项状态,是否启用 */
+    int nChannelCount;          /* 通道数 */
+};
+
+/* ====================================================================
+ * CompareItemInfo_t对比项结构体
+ * ==================================================================== */
+/* 对比项的通道信息 */
+struct CompareItemChannelInfo_t
+{
+    int nChannelID;             /* 通道ID */
+    QString strChannelName;     /* 通道名称 */
+    int nSoundCardNum;          /* 声卡通道编号 */
+    int strSoundCardName;       /* 声卡通道名称,可能使用这个名称打开录音通道 */
+    bool isEnableRecord;        /* 是否开启录音 */
+};
+
+
+/* 检测阈值,静音和过载是整数,反相是小数 */
+union Threshold_t
+{
+    uint64_t nThreshold;  /* 静音和过载的阈值 */
+    double dThreshold;    /* 反相的阈值 */
+};
+
+/**
+ * @brief 静音、过载、反相检测参数
+ * 
+ */
+struct CompareItemDetectParam_t
+{
+    bool isEnable = false;          /* 是否启用检测 */
+    Threshold_t threshold;          /* 检测阈值 */
+    int nLen = 0;                   /* 检测长度,单位秒 */
+    int nSensibility = 0.0;         /* 敏感度,0-100,0最不敏感,100最敏感 */
+
+    CompareItemDetectParam_t() = default;
+    CompareItemDetectParam_t(const CompareItemDetectParam_t &other);
+    CompareItemDetectParam_t& operator=(const CompareItemDetectParam_t &other);
+};
+
+/**
+ * @brief 对比项信息
+ * 
+ */
+struct CompareItemInfo_t
+{
+    int nID = -1;                               /* 对比项ID,对比项唯一识别号,不可更改 */
+    QString strName;                            /* 对比项名称 */
+    bool isEnable = false;                      /* 对比项状态,是否启用 */
+    QList<CompareItemChannelInfo_t> listChannels; /* 通道信息列表 */
+    CompareItemDetectParam_t muteParam;         /* 静音检测参数 */
+    CompareItemDetectParam_t overloadParam;     /* 过载检测参数 */
+    CompareItemDetectParam_t phaseParam;        /* 反相检测参数 */
+
+    CompareItemInfo_t() = default;
+    CompareItemInfo_t(const CompareItemInfo_t &other);
+    CompareItemInfo_t& operator=(const CompareItemInfo_t &other);
+};
+
+
+/* ====================================================================
+ * 声卡相关信息结构体
+ * ==================================================================== */
+
+/**
+ * @brief 声卡信息,这里的信息都是设备上和物理声卡相关的
+ * 
+ */
+struct SoundCardInfo_t
+{
+    int nSoundCardNum;                  /* 声卡编号 */
+    QString strSoundCardID;             /* 声卡ID */
+    QString strSoundCardName;           /* 声卡名称 */
+    QString strSoundCardDriver;         /* 声卡驱动名称 */
+    
+    QList<int> listRecordChannels;      /* 录音通道列表,存储通道编号 */
+};
+
+
+
+#endif // __GLOBAL_VARIABLE_H__

+ 103 - 0
SettingLibrary/DataManager/CompareItemData.cpp

@@ -0,0 +1,103 @@
+#include "CompareItemData.h"
+
+
+
+
+/* 初始化 */
+bool CompareItemDataManager::init()
+{
+    if(m_logger == nullptr)
+    {
+        m_logger = spdlog::get("CompareItemData");
+        if(m_logger == nullptr)
+        {
+            fmt::print("CompareItemDataManager: 初始化日志失败");
+            return false;
+        }
+    }
+
+    return true;
+}
+
+
+/* 添加一个对比项 */
+bool CompareItemDataManager::addCompareItem(const CompareItemInfo_t& item)
+{
+    if(isCompareItemExist(item.nID))
+    {
+        SPDLOG_LOGGER_WARN(m_logger, "对比项ID {} 已经存在,无法添加", item.nID);
+        return false;
+    }
+    m_listCompareItems.append(item);
+
+    return true;
+}
+
+/* 根据对比项ID删除一个对比项 */
+bool CompareItemDataManager::removeCompareItem(int nID)
+{
+    for(auto it = m_listCompareItems.begin(); it != m_listCompareItems.end(); ++it)
+    {
+        if(it->nID == nID)
+        {
+            m_listCompareItems.erase(it);
+            return true;
+        }
+    }
+    SPDLOG_LOGGER_WARN(m_logger, "对比项ID {} 不存在,无法删除", nID);
+    return false;
+}
+
+/* 通过一个ID查找一个对比项 */
+CompareItemInfo_t CompareItemDataManager::findCompareItemByID(int nID) const
+{
+    for(const auto& compareItem : m_listCompareItems)
+    {
+        if(compareItem.nID == nID)
+        {
+            return compareItem;
+        }
+    }
+    SPDLOG_LOGGER_WARN(m_logger, "对比项ID {} 不存在", nID);
+    return CompareItemInfo_t(); // 返回一个默认构造的对比项
+}
+
+/* 通过一个ID判断该对比项是否存在 */
+bool CompareItemDataManager::isCompareItemExist(int nID) const
+{
+    for(const auto& compareItem : m_listCompareItems)
+    {
+        if(compareItem.nID == nID)
+        {
+            return true;
+        }
+    }
+    return false;
+}
+
+/* 修改一个对比项 */
+bool CompareItemDataManager::modifyCompareItem(const CompareItemInfo_t& item)
+{
+    for(auto& compareItem : m_listCompareItems)
+    {
+        if(compareItem.nID == item.nID)
+        {
+            compareItem = item; // 使用赋值运算符更新对比项
+            return true;
+        }
+    }
+    SPDLOG_LOGGER_WARN(m_logger, "对比项ID {} 不存在,无法修改", item.nID);
+    return false;
+}
+
+/* 获取一个未使用的对比项ID */
+int CompareItemDataManager::getUnusedCompareItemID() const
+{
+    int nID = 1; // 从1开始
+    while(isCompareItemExist(nID))
+    {
+        ++nID;
+    }
+    return nID;
+}
+

+ 51 - 0
SettingLibrary/DataManager/CompareItemData.h

@@ -0,0 +1,51 @@
+#ifndef __COMPAREITEMDATA_H__
+#define __COMPAREITEMDATA_H__
+
+#include "GlobalVariable.h"
+#include "spdlog/spdlog.h"
+
+
+/* 对比项数据,管理对比项所有的数据 */
+
+#define CIData CompareItemDataManager::instance()
+class CompareItemDataManager
+{
+    CompareItemDataManager() = default;
+    CompareItemDataManager(const CompareItemDataManager&) = delete;
+    CompareItemDataManager& operator=(const CompareItemDataManager&) = delete;
+public:
+    ~CompareItemDataManager() = default;
+    static CompareItemDataManager& instance()
+    {
+        static CompareItemDataManager instance;
+        return instance;
+    }
+
+    /* 初始化 */
+    bool init();
+
+    /* 添加一个对比项 */
+    bool addCompareItem(const CompareItemInfo_t& item);
+    /* 根据对比项ID删除一个对比项 */
+    bool removeCompareItem(int nID);
+    /* 通过一个ID查找一个对比项 */
+    CompareItemInfo_t findCompareItemByID(int nID) const;
+    /* 通过一个ID判断该对比项是否存在 */
+    bool isCompareItemExist(int nID) const;
+    /* 修改一个对比项 */
+    bool modifyCompareItem(const CompareItemInfo_t& item);
+
+    /* 获取一个未使用的对比项ID */
+    int getUnusedCompareItemID() const;
+
+private:
+    std::shared_ptr<spdlog::logger> m_logger = nullptr;
+    /* 对比项列表 */
+    QList<CompareItemInfo_t> m_listCompareItems;
+    
+
+};
+
+
+
+#endif // __COMPAREITEMDATA_H__

+ 0 - 0
SettingLibrary/DataManager/SoundCardData.cpp


+ 8 - 0
SettingLibrary/DataManager/SoundCardData.h

@@ -0,0 +1,8 @@
+#ifndef __SOUNDCARDDATA_H__
+#define __SOUNDCARDDATA_H__
+
+#include "GlobalVariable.h"
+
+
+
+#endif // __SOUNDCARDDATA_H__

+ 18 - 6
SettingLibrary/DialogBase/DialogBase.cpp

@@ -27,7 +27,7 @@ DialogBase::DialogBase(QWidget *parent)
     /* 设置qss */
     connect(&UIStyle, &UIStyleManager::signal_qssChanged, this, &DialogBase::do_setQSS);
     /* 设置默认的UI */
-    setQSS();
+    setParentQSS();
 }
 
 DialogBase::~DialogBase()
@@ -105,6 +105,13 @@ bool DialogBase::removeBottomWidget()
     return true;
 }
 
+/* 点击确定按钮之前执行的操作 */
+bool DialogBase::isOKClicked()
+{
+    /* 默认返回true,子类可以重载这个函数来实现自定义的逻辑 */
+    return true;
+}
+
 /* 初始化UI */
 void DialogBase::initUI()
 {
@@ -116,7 +123,7 @@ void DialogBase::initUI()
 
     /*--------------------- 初始化背景容器 -----------------------*/
     m_widgetBackground = new QWidget(this);
-    m_widgetBackground->setObjectName("widget_background");
+    m_widgetBackground->setObjectName("widget_content__");
     QVBoxLayout* layout = new QVBoxLayout(this);
     /* 设置边距,就是阴影的宽度 */
     layout->setContentsMargins(20, 20, 20, 20);
@@ -209,11 +216,11 @@ void DialogBase::initSettings()
     connect(m_pBtn_Cancel, &QPushButton::clicked, this, &DialogBase::do_pBtnCancel_clicked);
 
     /* 设置样式表 */
-    // setQSS();
+    setParentQSS();
 }
 
 /* 加载QSS */
-void DialogBase::setQSS()
+void DialogBase::setParentQSS()
 {
     /* 获取样式表路径 */
     QString qssPath = UIStyle.getQSSPath() + "/dialogbase.qss";
@@ -222,7 +229,7 @@ void DialogBase::setQSS()
     {
         QString qss = file.readAll();
         file.close();
-        this->setStyleSheet(qss);
+        m_widgetBackground->setStyleSheet(qss);
     } else
     {
         SPDLOG_LOGGER_ERROR(m_logger, "打开QSS文件失败: {}", qssPath.toStdString());
@@ -243,6 +250,11 @@ void DialogBase::layoutTop()
 /* 确认按钮点击事件 */
 void DialogBase::do_pBtn_OK_Clicked()
 {
+    if(!isOKClicked())
+    {
+        /* 如果子类没有重载这个函数,默认返回true */
+        return;
+    }
     m_isOK = true;
     this->accept();
 }
@@ -250,7 +262,7 @@ void DialogBase::do_pBtn_OK_Clicked()
 /* 设置QSS */
 void DialogBase::do_setQSS(EUIStyle style)
 {
-    setQSS();
+    setParentQSS();
 }
 
 /* 重写鼠标按下事件 */

+ 6 - 1
SettingLibrary/DialogBase/DialogBase.h

@@ -30,6 +30,8 @@ public:
 
     /* 获取标题 */
     QString getTitle() const;
+    /* 获取是否点击了确定按钮 */
+    virtual bool isOK() const { return m_isOK; }
 
 protected:
     /* --------------------------------------------------
@@ -47,13 +49,16 @@ protected:
     /* 获取底部容器指针 */
     QWidget* getBottomWidget() const { return m_widgetBottom; }
 
+    /* 点击确定按钮之前执行的操作 */
+    virtual bool isOKClicked();
+
 protected:
     /* 初始化UI */
     virtual void initUI();
     /* 初始化其他设置 */
     virtual void initSettings();
     /* 加载QSS */
-    virtual void setQSS();
+    virtual void setParentQSS();
     /* 设置top栏的位置布局 */
     void layoutTop();
 

+ 951 - 0
SettingLibrary/Modules/Basic/CompareItemWidget.ui

@@ -0,0 +1,951 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>CompareItemWidget</class>
+ <widget class="QWidget" name="CompareItemWidget">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>1192</width>
+    <height>897</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Form</string>
+  </property>
+  <property name="styleSheet">
+   <string notr="true"/>
+  </property>
+  <layout class="QVBoxLayout" name="verticalLayout">
+   <property name="spacing">
+    <number>0</number>
+   </property>
+   <property name="leftMargin">
+    <number>0</number>
+   </property>
+   <property name="topMargin">
+    <number>0</number>
+   </property>
+   <property name="rightMargin">
+    <number>0</number>
+   </property>
+   <property name="bottomMargin">
+    <number>0</number>
+   </property>
+   <item>
+    <widget class="QWidget" name="widgetContent" native="true">
+     <layout class="QVBoxLayout" name="verticalLayout_4">
+      <property name="spacing">
+       <number>16</number>
+      </property>
+      <property name="leftMargin">
+       <number>32</number>
+      </property>
+      <property name="topMargin">
+       <number>32</number>
+      </property>
+      <property name="rightMargin">
+       <number>32</number>
+      </property>
+      <property name="bottomMargin">
+       <number>0</number>
+      </property>
+      <item>
+       <widget class="QWidget" name="widget_computeItem" native="true">
+        <layout class="QVBoxLayout" name="verticalLayout_2">
+         <property name="spacing">
+          <number>16</number>
+         </property>
+         <property name="sizeConstraint">
+          <enum>QLayout::SetNoConstraint</enum>
+         </property>
+         <property name="leftMargin">
+          <number>0</number>
+         </property>
+         <property name="topMargin">
+          <number>0</number>
+         </property>
+         <property name="rightMargin">
+          <number>0</number>
+         </property>
+         <property name="bottomMargin">
+          <number>16</number>
+         </property>
+         <item>
+          <widget class="QLabel" name="labelBase">
+           <property name="text">
+            <string>基础信息</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QWidget" name="widget_3" native="true">
+           <property name="minimumSize">
+            <size>
+             <width>1094</width>
+             <height>32</height>
+            </size>
+           </property>
+           <property name="maximumSize">
+            <size>
+             <width>1094</width>
+             <height>32</height>
+            </size>
+           </property>
+           <layout class="QHBoxLayout" name="horizontalLayout_3">
+            <property name="spacing">
+             <number>0</number>
+            </property>
+            <property name="leftMargin">
+             <number>0</number>
+            </property>
+            <property name="topMargin">
+             <number>0</number>
+            </property>
+            <property name="rightMargin">
+             <number>0</number>
+            </property>
+            <property name="bottomMargin">
+             <number>0</number>
+            </property>
+            <item>
+             <widget class="QLabel" name="label_11">
+              <property name="minimumSize">
+               <size>
+                <width>92</width>
+                <height>32</height>
+               </size>
+              </property>
+              <property name="maximumSize">
+               <size>
+                <width>92</width>
+                <height>32</height>
+               </size>
+              </property>
+              <property name="text">
+               <string>&lt;font color = #D21F21 &gt;*&lt;/font&gt;对比项名称:</string>
+              </property>
+              <property name="alignment">
+               <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <widget class="QLineEdit" name="lineEdit_6">
+              <property name="minimumSize">
+               <size>
+                <width>320</width>
+                <height>32</height>
+               </size>
+              </property>
+              <property name="maximumSize">
+               <size>
+                <width>320</width>
+                <height>32</height>
+               </size>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <spacer name="horizontalSpacer_3">
+              <property name="orientation">
+               <enum>Qt::Horizontal</enum>
+              </property>
+              <property name="sizeType">
+               <enum>QSizePolicy::Fixed</enum>
+              </property>
+              <property name="sizeHint" stdset="0">
+               <size>
+                <width>24</width>
+                <height>20</height>
+               </size>
+              </property>
+             </spacer>
+            </item>
+            <item>
+             <widget class="QCheckBox" name="checkBox_enable">
+              <property name="text">
+               <string>勾选启用该对比项,否则不做任何检测及对比,同时客户端界面上也不显示</string>
+              </property>
+             </widget>
+            </item>
+           </layout>
+          </widget>
+         </item>
+         <item>
+          <widget class="SingleCompareRoadWidget" name="widget_mainRoad" native="true">
+           <property name="minimumSize">
+            <size>
+             <width>1106</width>
+             <height>32</height>
+            </size>
+           </property>
+           <property name="maximumSize">
+            <size>
+             <width>1106</width>
+             <height>32</height>
+            </size>
+           </property>
+           <property name="bDelBtnVisible" stdset="0">
+            <bool>false</bool>
+           </property>
+           <property name="nIndex" stdset="0">
+            <number>1</number>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="SingleCompareRoadWidget" name="widget_secondRoad" native="true">
+           <property name="minimumSize">
+            <size>
+             <width>1106</width>
+             <height>32</height>
+            </size>
+           </property>
+           <property name="maximumSize">
+            <size>
+             <width>1106</width>
+             <height>32</height>
+            </size>
+           </property>
+           <property name="bDelBtnVisible" stdset="0">
+            <bool>false</bool>
+           </property>
+           <property name="nIndex" stdset="0">
+            <number>2</number>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QWidget" name="widget" native="true">
+           <property name="minimumSize">
+            <size>
+             <width>0</width>
+             <height>224</height>
+            </size>
+           </property>
+           <property name="maximumSize">
+            <size>
+             <width>16777215</width>
+             <height>224</height>
+            </size>
+           </property>
+           <layout class="QVBoxLayout" name="verticalLayout_3">
+            <property name="spacing">
+             <number>16</number>
+            </property>
+            <property name="leftMargin">
+             <number>0</number>
+            </property>
+            <property name="topMargin">
+             <number>0</number>
+            </property>
+            <property name="rightMargin">
+             <number>0</number>
+            </property>
+            <property name="bottomMargin">
+             <number>0</number>
+            </property>
+            <item>
+             <widget class="QWidget" name="widget_6" native="true">
+              <layout class="QHBoxLayout" name="horizontalLayout_5">
+               <property name="spacing">
+                <number>8</number>
+               </property>
+               <property name="leftMargin">
+                <number>0</number>
+               </property>
+               <property name="topMargin">
+                <number>0</number>
+               </property>
+               <property name="rightMargin">
+                <number>0</number>
+               </property>
+               <property name="bottomMargin">
+                <number>0</number>
+               </property>
+               <item>
+                <widget class="QLabel" name="labelOtherRoad">
+                 <property name="text">
+                  <string>其他通道</string>
+                 </property>
+                </widget>
+               </item>
+               <item>
+                <widget class="QPushButton" name="pBtn_add">
+                 <property name="minimumSize">
+                  <size>
+                   <width>32</width>
+                   <height>32</height>
+                  </size>
+                 </property>
+                 <property name="maximumSize">
+                  <size>
+                   <width>32</width>
+                   <height>32</height>
+                  </size>
+                 </property>
+                 <property name="text">
+                  <string/>
+                 </property>
+                </widget>
+               </item>
+               <item>
+                <spacer name="horizontalSpacer_4">
+                 <property name="orientation">
+                  <enum>Qt::Horizontal</enum>
+                 </property>
+                 <property name="sizeHint" stdset="0">
+                  <size>
+                   <width>40</width>
+                   <height>20</height>
+                  </size>
+                 </property>
+                </spacer>
+               </item>
+              </layout>
+             </widget>
+            </item>
+            <item>
+             <widget class="QScrollArea" name="scrollArea">
+              <property name="verticalScrollBarPolicy">
+               <enum>Qt::ScrollBarAsNeeded</enum>
+              </property>
+              <property name="horizontalScrollBarPolicy">
+               <enum>Qt::ScrollBarAlwaysOff</enum>
+              </property>
+              <property name="widgetResizable">
+               <bool>true</bool>
+              </property>
+              <widget class="QWidget" name="scrollAreaWidgetContents">
+               <property name="geometry">
+                <rect>
+                 <x>0</x>
+                 <y>0</y>
+                 <width>1126</width>
+                 <height>174</height>
+                </rect>
+               </property>
+               <layout class="QVBoxLayout" name="verticalLayout_6">
+                <property name="spacing">
+                 <number>16</number>
+                </property>
+                <property name="leftMargin">
+                 <number>0</number>
+                </property>
+                <property name="topMargin">
+                 <number>0</number>
+                </property>
+                <property name="rightMargin">
+                 <number>0</number>
+                </property>
+                <property name="bottomMargin">
+                 <number>0</number>
+                </property>
+                <item>
+                 <spacer name="verticalSpacer">
+                  <property name="orientation">
+                   <enum>Qt::Vertical</enum>
+                  </property>
+                  <property name="sizeHint" stdset="0">
+                   <size>
+                    <width>20</width>
+                    <height>173</height>
+                   </size>
+                  </property>
+                 </spacer>
+                </item>
+               </layout>
+              </widget>
+             </widget>
+            </item>
+           </layout>
+          </widget>
+         </item>
+        </layout>
+       </widget>
+      </item>
+      <item>
+       <widget class="QWidget" name="widget_compareSetting" native="true">
+        <layout class="QVBoxLayout" name="verticalLayout_5">
+         <property name="spacing">
+          <number>16</number>
+         </property>
+         <property name="leftMargin">
+          <number>0</number>
+         </property>
+         <property name="topMargin">
+          <number>0</number>
+         </property>
+         <property name="rightMargin">
+          <number>0</number>
+         </property>
+         <property name="bottomMargin">
+          <number>0</number>
+         </property>
+         <item>
+          <widget class="QLabel" name="label_soundCompute">
+           <property name="minimumSize">
+            <size>
+             <width>0</width>
+             <height>16</height>
+            </size>
+           </property>
+           <property name="maximumSize">
+            <size>
+             <width>16777215</width>
+             <height>16</height>
+            </size>
+           </property>
+           <property name="text">
+            <string>音频监测配置</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QWidget" name="widgetMute" native="true">
+           <property name="minimumSize">
+            <size>
+             <width>0</width>
+             <height>116</height>
+            </size>
+           </property>
+           <property name="maximumSize">
+            <size>
+             <width>16777215</width>
+             <height>116</height>
+            </size>
+           </property>
+           <widget class="QLabel" name="labelMute">
+            <property name="geometry">
+             <rect>
+              <x>0</x>
+              <y>0</y>
+              <width>41</width>
+              <height>14</height>
+             </rect>
+            </property>
+            <property name="text">
+             <string>静音</string>
+            </property>
+           </widget>
+           <widget class="QLabel" name="label_3">
+            <property name="geometry">
+             <rect>
+              <x>0</x>
+              <y>30</y>
+              <width>70</width>
+              <height>22</height>
+             </rect>
+            </property>
+            <property name="text">
+             <string>静音检测:</string>
+            </property>
+           </widget>
+           <widget class="QCheckBox" name="checkBoxMute">
+            <property name="geometry">
+             <rect>
+              <x>70</x>
+              <y>30</y>
+              <width>100</width>
+              <height>22</height>
+             </rect>
+            </property>
+            <property name="text">
+             <string>开启</string>
+            </property>
+           </widget>
+           <widget class="QLabel" name="label_4">
+            <property name="geometry">
+             <rect>
+              <x>0</x>
+              <y>68</y>
+              <width>70</width>
+              <height>32</height>
+             </rect>
+            </property>
+            <property name="text">
+             <string>静音阈值:</string>
+            </property>
+           </widget>
+           <widget class="QLineEdit" name="lineEditMuteThreshold">
+            <property name="geometry">
+             <rect>
+              <x>82</x>
+              <y>68</y>
+              <width>78</width>
+              <height>32</height>
+             </rect>
+            </property>
+           </widget>
+           <widget class="QLabel" name="label_5">
+            <property name="geometry">
+             <rect>
+              <x>164</x>
+              <y>68</y>
+              <width>82</width>
+              <height>32</height>
+             </rect>
+            </property>
+            <property name="text">
+             <string>(40~84)dBFS</string>
+            </property>
+           </widget>
+           <widget class="QLabel" name="label_6">
+            <property name="geometry">
+             <rect>
+              <x>70</x>
+              <y>68</y>
+              <width>5</width>
+              <height>32</height>
+             </rect>
+            </property>
+            <property name="text">
+             <string>-</string>
+            </property>
+           </widget>
+           <widget class="QLabel" name="label_7">
+            <property name="geometry">
+             <rect>
+              <x>270</x>
+              <y>68</y>
+              <width>70</width>
+              <height>32</height>
+             </rect>
+            </property>
+            <property name="text">
+             <string>判断时长:</string>
+            </property>
+           </widget>
+           <widget class="QLineEdit" name="lineEditMuteLen">
+            <property name="geometry">
+             <rect>
+              <x>340</x>
+              <y>68</y>
+              <width>90</width>
+              <height>32</height>
+             </rect>
+            </property>
+           </widget>
+           <widget class="QLabel" name="label_8">
+            <property name="geometry">
+             <rect>
+              <x>434</x>
+              <y>68</y>
+              <width>61</width>
+              <height>32</height>
+             </rect>
+            </property>
+            <property name="text">
+             <string>(2~90)s</string>
+            </property>
+           </widget>
+           <widget class="QLabel" name="label_9">
+            <property name="geometry">
+             <rect>
+              <x>684</x>
+              <y>68</y>
+              <width>81</width>
+              <height>32</height>
+             </rect>
+            </property>
+            <property name="text">
+             <string>(22~100)%</string>
+            </property>
+           </widget>
+           <widget class="QLabel" name="label_10">
+            <property name="geometry">
+             <rect>
+              <x>506</x>
+              <y>68</y>
+              <width>84</width>
+              <height>32</height>
+             </rect>
+            </property>
+            <property name="text">
+             <string>静音灵敏度:</string>
+            </property>
+           </widget>
+           <widget class="QLineEdit" name="lineEditMuteSensibility">
+            <property name="geometry">
+             <rect>
+              <x>590</x>
+              <y>68</y>
+              <width>90</width>
+              <height>32</height>
+             </rect>
+            </property>
+           </widget>
+          </widget>
+         </item>
+         <item>
+          <widget class="QWidget" name="widgetOverload" native="true">
+           <property name="minimumSize">
+            <size>
+             <width>0</width>
+             <height>116</height>
+            </size>
+           </property>
+           <property name="maximumSize">
+            <size>
+             <width>16777215</width>
+             <height>116</height>
+            </size>
+           </property>
+           <widget class="QLabel" name="labelOverload">
+            <property name="geometry">
+             <rect>
+              <x>0</x>
+              <y>0</y>
+              <width>41</width>
+              <height>14</height>
+             </rect>
+            </property>
+            <property name="text">
+             <string>过载</string>
+            </property>
+           </widget>
+           <widget class="QLabel" name="label_13">
+            <property name="geometry">
+             <rect>
+              <x>0</x>
+              <y>30</y>
+              <width>70</width>
+              <height>22</height>
+             </rect>
+            </property>
+            <property name="text">
+             <string>过载检测:</string>
+            </property>
+           </widget>
+           <widget class="QCheckBox" name="checkBoxOverload">
+            <property name="geometry">
+             <rect>
+              <x>70</x>
+              <y>30</y>
+              <width>100</width>
+              <height>22</height>
+             </rect>
+            </property>
+            <property name="text">
+             <string>开启</string>
+            </property>
+           </widget>
+           <widget class="QLabel" name="label_14">
+            <property name="geometry">
+             <rect>
+              <x>0</x>
+              <y>68</y>
+              <width>70</width>
+              <height>32</height>
+             </rect>
+            </property>
+            <property name="text">
+             <string>过载阈值:</string>
+            </property>
+           </widget>
+           <widget class="QLineEdit" name="lineEditOverloadThreshold">
+            <property name="geometry">
+             <rect>
+              <x>82</x>
+              <y>68</y>
+              <width>78</width>
+              <height>32</height>
+             </rect>
+            </property>
+           </widget>
+           <widget class="QLabel" name="label_15">
+            <property name="geometry">
+             <rect>
+              <x>164</x>
+              <y>68</y>
+              <width>82</width>
+              <height>32</height>
+             </rect>
+            </property>
+            <property name="text">
+             <string>(0~40)dBFS</string>
+            </property>
+           </widget>
+           <widget class="QLabel" name="label_16">
+            <property name="geometry">
+             <rect>
+              <x>70</x>
+              <y>68</y>
+              <width>5</width>
+              <height>32</height>
+             </rect>
+            </property>
+            <property name="text">
+             <string>-</string>
+            </property>
+           </widget>
+           <widget class="QLabel" name="label_17">
+            <property name="geometry">
+             <rect>
+              <x>270</x>
+              <y>68</y>
+              <width>70</width>
+              <height>32</height>
+             </rect>
+            </property>
+            <property name="text">
+             <string>判断时长:</string>
+            </property>
+           </widget>
+           <widget class="QLineEdit" name="lineEditOverloadLen">
+            <property name="geometry">
+             <rect>
+              <x>340</x>
+              <y>68</y>
+              <width>90</width>
+              <height>32</height>
+             </rect>
+            </property>
+           </widget>
+           <widget class="QLabel" name="label_18">
+            <property name="geometry">
+             <rect>
+              <x>434</x>
+              <y>68</y>
+              <width>61</width>
+              <height>32</height>
+             </rect>
+            </property>
+            <property name="text">
+             <string>(2~90)s</string>
+            </property>
+           </widget>
+           <widget class="QLabel" name="label_19">
+            <property name="geometry">
+             <rect>
+              <x>684</x>
+              <y>68</y>
+              <width>81</width>
+              <height>32</height>
+             </rect>
+            </property>
+            <property name="text">
+             <string>(22~100)%</string>
+            </property>
+           </widget>
+           <widget class="QLabel" name="label_20">
+            <property name="geometry">
+             <rect>
+              <x>506</x>
+              <y>68</y>
+              <width>84</width>
+              <height>32</height>
+             </rect>
+            </property>
+            <property name="text">
+             <string>过载灵敏度:</string>
+            </property>
+           </widget>
+           <widget class="QLineEdit" name="lineEditOverloadSensibility">
+            <property name="geometry">
+             <rect>
+              <x>590</x>
+              <y>68</y>
+              <width>90</width>
+              <height>32</height>
+             </rect>
+            </property>
+           </widget>
+          </widget>
+         </item>
+         <item>
+          <widget class="QWidget" name="widgetPhase" native="true">
+           <property name="minimumSize">
+            <size>
+             <width>0</width>
+             <height>116</height>
+            </size>
+           </property>
+           <property name="maximumSize">
+            <size>
+             <width>16777215</width>
+             <height>116</height>
+            </size>
+           </property>
+           <widget class="QLabel" name="labelPhase">
+            <property name="geometry">
+             <rect>
+              <x>0</x>
+              <y>0</y>
+              <width>41</width>
+              <height>14</height>
+             </rect>
+            </property>
+            <property name="text">
+             <string>反相</string>
+            </property>
+           </widget>
+           <widget class="QLabel" name="label_22">
+            <property name="geometry">
+             <rect>
+              <x>0</x>
+              <y>30</y>
+              <width>70</width>
+              <height>22</height>
+             </rect>
+            </property>
+            <property name="text">
+             <string>反相检测:</string>
+            </property>
+           </widget>
+           <widget class="QCheckBox" name="checkBoxPhase">
+            <property name="geometry">
+             <rect>
+              <x>70</x>
+              <y>30</y>
+              <width>100</width>
+              <height>22</height>
+             </rect>
+            </property>
+            <property name="text">
+             <string>开启</string>
+            </property>
+           </widget>
+           <widget class="QLabel" name="label_23">
+            <property name="geometry">
+             <rect>
+              <x>0</x>
+              <y>68</y>
+              <width>70</width>
+              <height>32</height>
+             </rect>
+            </property>
+            <property name="text">
+             <string>反相阈值:</string>
+            </property>
+           </widget>
+           <widget class="QLineEdit" name="lineEditPhaseThreshold">
+            <property name="geometry">
+             <rect>
+              <x>82</x>
+              <y>68</y>
+              <width>78</width>
+              <height>32</height>
+             </rect>
+            </property>
+           </widget>
+           <widget class="QLabel" name="label_24">
+            <property name="geometry">
+             <rect>
+              <x>164</x>
+              <y>68</y>
+              <width>82</width>
+              <height>32</height>
+             </rect>
+            </property>
+            <property name="text">
+             <string>(0~0.99)</string>
+            </property>
+           </widget>
+           <widget class="QLabel" name="label_25">
+            <property name="geometry">
+             <rect>
+              <x>70</x>
+              <y>68</y>
+              <width>5</width>
+              <height>32</height>
+             </rect>
+            </property>
+            <property name="text">
+             <string>-</string>
+            </property>
+           </widget>
+           <widget class="QLabel" name="label_26">
+            <property name="geometry">
+             <rect>
+              <x>270</x>
+              <y>68</y>
+              <width>70</width>
+              <height>32</height>
+             </rect>
+            </property>
+            <property name="text">
+             <string>判断时长:</string>
+            </property>
+           </widget>
+           <widget class="QLineEdit" name="lineEditPhaseLen">
+            <property name="geometry">
+             <rect>
+              <x>340</x>
+              <y>68</y>
+              <width>90</width>
+              <height>32</height>
+             </rect>
+            </property>
+           </widget>
+           <widget class="QLabel" name="label_27">
+            <property name="geometry">
+             <rect>
+              <x>434</x>
+              <y>68</y>
+              <width>61</width>
+              <height>32</height>
+             </rect>
+            </property>
+            <property name="text">
+             <string>(10~90)s</string>
+            </property>
+           </widget>
+           <widget class="QLabel" name="label_28">
+            <property name="geometry">
+             <rect>
+              <x>684</x>
+              <y>68</y>
+              <width>81</width>
+              <height>32</height>
+             </rect>
+            </property>
+            <property name="text">
+             <string>(22~100)%</string>
+            </property>
+           </widget>
+           <widget class="QLabel" name="label_29">
+            <property name="geometry">
+             <rect>
+              <x>506</x>
+              <y>68</y>
+              <width>84</width>
+              <height>32</height>
+             </rect>
+            </property>
+            <property name="text">
+             <string>反相灵敏度:</string>
+            </property>
+           </widget>
+           <widget class="QLineEdit" name="lineEditPhaseSensibility">
+            <property name="geometry">
+             <rect>
+              <x>590</x>
+              <y>68</y>
+              <width>90</width>
+              <height>32</height>
+             </rect>
+            </property>
+           </widget>
+          </widget>
+         </item>
+        </layout>
+       </widget>
+      </item>
+     </layout>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <customwidgets>
+  <customwidget>
+   <class>SingleCompareRoadWidget</class>
+   <extends>QWidget</extends>
+   <header>Modules/Basic/singlecompareroadwidget.h</header>
+   <container>1</container>
+  </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>

+ 159 - 12
SettingLibrary/Modules/Basic/compareitemdialog.cpp

@@ -1,18 +1,34 @@
 #include "compareitemdialog.h"
-#include "ui_compareitemdialog.h"
+#include "ui_compareitemwidget.h"
+
+#include "UIStyleManager.h"
 
 CompareItemDialog::CompareItemDialog(QWidget *parent)
-    : QDialog(parent)
-    , ui(new Ui::CompareItemDialog)
+    : DialogBase(parent)
+    , ui(new Ui::CompareItemWidget)
 {
-    ui->setupUi(this);
+    QWidget *widgetContent = new QWidget(this);
+    ui->setupUi(widgetContent);
+
+    /* 设置内容 */
+    setContentWidget(widgetContent);
+    /* 设置标题 */
+    setTitle("对比项信息", QSize(120, 18));
+
+    /* 连接信号和槽 */
+    connect(ui->pBtn_add, &QPushButton::clicked, this, &CompareItemDialog::do_pBtn_add_clicked);
+    /* 连接静音、过载、反相三个按钮的开关 */
+    connect(ui->checkBoxMute, &QCheckBox::clicked, this, &CompareItemDialog::do_checkBox_MOP_clicked);
+    connect(ui->checkBoxOverload, &QCheckBox::clicked, this, &CompareItemDialog::do_checkBox_MOP_clicked);
+    connect(ui->checkBoxPhase, &QCheckBox::clicked, this, &CompareItemDialog::do_checkBox_MOP_clicked);
 
-    setWindowFlag(Qt::FramelessWindowHint);
-    setAttribute(Qt::WA_TranslucentBackground);
+    /* 设置默认开启 */
+    ui->checkBoxMute->setChecked(true);
+    ui->checkBoxOverload->setChecked(true);
+    ui->checkBoxPhase->setChecked(true);
 
-    connect(ui->btnCancel, &QPushButton::clicked, this, &CompareItemDialog::reject);
-    connect(ui->btnClose, &QPushButton::clicked, this, &CompareItemDialog::close);
-    connect(ui->btnAdd, &QPushButton::clicked, this, &CompareItemDialog::OnBtnAddClicked);
+    /* 设置样式 */
+    setQSS();
 }
 
 CompareItemDialog::~CompareItemDialog()
@@ -20,21 +36,32 @@ CompareItemDialog::~CompareItemDialog()
     delete ui;
 }
 
-void CompareItemDialog::OnBtnAddClicked()
+/* 获取生成的对比项信息 */
+CompareItemInfo_t& CompareItemDialog::getCompareItemInfo()
+{
+    return m_compareItemInfo;
+}
+
+
+
+/* 新增通道 */
+void CompareItemDialog::do_pBtn_add_clicked()
 {
     QVBoxLayout* pLayout = qobject_cast<QVBoxLayout*>(ui->scrollAreaWidgetContents->layout());
     if(pLayout)
     {
         SingleCompareRoadWidget *pWgt = new SingleCompareRoadWidget(this);
-        connect(pWgt, &SingleCompareRoadWidget::deleted, this, &CompareItemDialog::OnCompareRoadWgtDeleted);
+        connect(pWgt, &SingleCompareRoadWidget::deleted, this, &CompareItemDialog::do_CompareRoadWgtDeleted);
         pWgt->setIndex(m_listOtherRoadWgt.size() + 3);
         pWgt->setDelBtnVisible(true);
+        pWgt->setStyleSheet(m_qssRecordRoad);
         pLayout->insertWidget(m_listOtherRoadWgt.size(), pWgt);
         m_listOtherRoadWgt.append(pWgt);
     }
 }
 
-void CompareItemDialog::OnCompareRoadWgtDeleted(int nIndex)
+/* 删除通道 */
+void CompareItemDialog::do_CompareRoadWgtDeleted(int nIndex)
 {
     int nRealIndex = nIndex - 3;
     if(nRealIndex < m_listOtherRoadWgt.size())
@@ -49,3 +76,123 @@ void CompareItemDialog::OnCompareRoadWgtDeleted(int nIndex)
         m_listOtherRoadWgt.at(i)->setIndex(i + 3);
     }
 }
+
+/* 静音、过载、反相检测条件开关 */
+void CompareItemDialog::do_checkBox_MOP_clicked(bool checked)
+{
+    /* 获取信号发送者 */
+    QCheckBox *checkBox = qobject_cast<QCheckBox*>(sender());
+    checkBox->setText(checked ? "开启" : "关闭");
+    if(checkBox == ui->checkBoxMute)
+    {
+        setMOPEditable(EDBType::DBType_Mute, checked);
+    }
+    else if(checkBox == ui->checkBoxOverload)
+    {
+        setMOPEditable(EDBType::DBType_Overload, checked);
+    }
+    else if(checkBox == ui->checkBoxPhase)
+    {
+        setMOPEditable(EDBType::DBType_Phase, checked);
+    }
+}
+
+/* 设置样式表 */
+void CompareItemDialog::setQSS()
+{
+    QString qssPath = UIStyle.getQSSPath() + "/compareitemwidget.qss";
+    QFile file(qssPath);
+    if(file.open(QFile::ReadOnly))
+    {
+        QString qss = file.readAll();
+        file.close();
+        /* 这里设置的是内容容器样式表,this是最外层的 */
+        getContentWidget()->setStyleSheet(qss);
+        ui->scrollArea->setStyleSheet(qss);
+        ui->scrollAreaWidgetContents->setStyleSheet(qss);
+    } else
+    {
+        SPDLOG_LOGGER_ERROR(m_logger, "打开QSS文件失败: {}", qssPath.toStdString());
+        SPDLOG_LOGGER_ERROR(m_logger, "错误信息: {}", file.errorString().toStdString());
+    }
+    /* 清除父类的qss */
+    // this->setStyleSheet("");
+    // SPDLOG_LOGGER_INFO(m_logger, "qss: {}", getContentWidget()->styleSheet().toStdString());
+    // ui->scrollArea->viewport()->setStyleSheet("background-color: #FFFFFF;"); // 设置滚动区域背景透明
+
+    file.setFileName(UIStyle.getQSSPath() + "/singlecompareroadwidget.qss");
+    if(file.open(QFile::ReadOnly))
+    {
+        m_qssRecordRoad = file.readAll();
+        file.close();
+    } else
+    {
+        SPDLOG_LOGGER_ERROR(m_logger, "打开QSS文件失败: {}", file.fileName().toStdString());
+        SPDLOG_LOGGER_ERROR(m_logger, "错误信息: {}", file.errorString().toStdString());
+    }
+    ui->widget_mainRoad->setStyleSheet(m_qssRecordRoad);
+    ui->widget_secondRoad->setStyleSheet(m_qssRecordRoad);
+}
+
+/* 设置静音过载反相可编辑 */
+void CompareItemDialog::setMOPEditable(EDBType type, bool editable)
+{
+    if(type == EDBType::DBType_Mute)
+    {
+        if(editable)
+        {
+            ui->lineEditMuteLen->setEnabled(true);
+            ui->lineEditMuteSensibility->setEnabled(true);
+            ui->lineEditMuteThreshold->setEnabled(true);
+        }else {
+            ui->lineEditMuteLen->setEnabled(false);
+            ui->lineEditMuteSensibility->setEnabled(false);
+            ui->lineEditMuteThreshold->setEnabled(false);
+        }
+    }
+    else if(type == EDBType::DBType_Overload)
+    {
+        if(editable)
+        {
+            ui->lineEditOverloadLen->setEnabled(true);
+            ui->lineEditOverloadSensibility->setEnabled(true);
+            ui->lineEditOverloadThreshold->setEnabled(true);
+        }else {
+            ui->lineEditOverloadLen->setEnabled(false);
+            ui->lineEditOverloadSensibility->setEnabled(false);
+            ui->lineEditOverloadThreshold->setEnabled(false);
+        }
+    }
+    else if(type == EDBType::DBType_Phase)
+    {
+        if(editable)
+        {
+            ui->lineEditPhaseLen->setEnabled(true);
+            ui->lineEditPhaseSensibility->setEnabled(true);
+            ui->lineEditPhaseThreshold->setEnabled(true);
+        }else {
+            ui->lineEditPhaseLen->setEnabled(false);
+            ui->lineEditPhaseSensibility->setEnabled(false);
+            ui->lineEditPhaseThreshold->setEnabled(false);
+        }
+    }
+}
+
+/* 重载按下关闭按钮之前的操作 */
+bool CompareItemDialog::isOKClicked()
+{
+    /* 获取对比项的信息 */
+    
+
+    /* 获取主通道信息 */
+
+    /* 获取第二通道信息 */
+
+    /* 获取其他通道信息 */
+
+    /* 获取音频检测信息 */
+
+    return true;
+}
+
+

+ 39 - 5
SettingLibrary/Modules/Basic/compareitemdialog.h

@@ -1,16 +1,28 @@
 #ifndef COMPAREITEMDIALOG_H
 #define COMPAREITEMDIALOG_H
 
+#include "DialogBase.h"
 #include "singlecompareroadwidget.h"
+#include "GlobalVariable.h"
 
 #include <QDialog>
 #include <QVBoxLayout>
 
 namespace Ui {
-class CompareItemDialog;
+class CompareItemWidget;
 }
 
-class CompareItemDialog : public QDialog
+enum class EDBType
+{
+    DBType_Mute,
+    DBType_Overload,
+    DBType_Phase
+};
+
+
+
+
+class CompareItemDialog : public DialogBase
 {
     Q_OBJECT
 
@@ -18,14 +30,36 @@ public:
     explicit CompareItemDialog(QWidget *parent = nullptr);
     ~CompareItemDialog();
 
+    /* 获取生成的对比项信息 */
+    CompareItemInfo_t& getCompareItemInfo();
+
+
 private slots:
-    void OnBtnAddClicked();
-    void OnCompareRoadWgtDeleted(int nIndex);
+    /* 新增通道 */
+    void do_pBtn_add_clicked();
+    /* 删除通道 */
+    void do_CompareRoadWgtDeleted(int nIndex);
 
+    /* 静音、过载、反相检测条件开关 */
+    void do_checkBox_MOP_clicked(bool checked);
+    
 private:
-    Ui::CompareItemDialog *ui;
+    /* 设置样式表 */
+    void setQSS();
+    /* 设置静音过载反相可编辑 */
+    void setMOPEditable(EDBType type, bool editable);
+    
+    /* 重载按下关闭按钮之前的操作 */
+    bool isOKClicked() override;
 
+private:
+    Ui::CompareItemWidget *ui;
     QList<SingleCompareRoadWidget*> m_listOtherRoadWgt;
+
+    CompareItemInfo_t m_compareItemInfo;    /* 对比项信息 */
+
+    QString m_qssRecordRoad;                /* 录音通道的样式表 */
+
 };
 
 #endif // COMPAREITEMDIALOG_H

+ 1 - 1
SettingLibrary/Modules/Basic/compareitemdialog.ui

@@ -527,7 +527,7 @@ QScrollBar::handle:vertical:pressed
                    </widget>
                   </item>
                   <item>
-                   <widget class="QPushButton" name="btnAdd">
+                   <widget class="QPushButton" name="pBtn_add">
                     <property name="minimumSize">
                      <size>
                       <width>32</width>

+ 51 - 9
SettingLibrary/Modules/Basic/compareitemlistdialog.cpp

@@ -130,13 +130,22 @@ void CompareItemListDialog::initTable()
     // 设置选择模式为整行选择
     ui->tableView->setSelectionMode(QAbstractItemView::SingleSelection);
     ui->tableView->setSelectionBehavior(QAbstractItemView::SelectRows);
-    
-    /* 设置每列的高度 */
-    ui->tableView->verticalHeader()->setDefaultSectionSize(48);
 
-    
+    /*--------------------------- 设置横向标题 -------------------------------*/
     /* 设置横向标题可见 */
     ui->tableView->horizontalHeader()->setVisible(true);
+    /* 设置标题左对齐 */
+    ui->tableView->horizontalHeader()->setDefaultAlignment(Qt::AlignLeft | Qt::AlignVCenter);
+    /* 设置横向标题不可点击 */
+    ui->tableView->horizontalHeader()->setSectionsClickable(false);
+
+    /*--------------------------- 设置列 -------------------------------*/
+    /* 设置每列的高度 */
+    ui->tableView->verticalHeader()->setDefaultSectionSize(48);
+    /* 设置横向表头高度为48像素(可根据需要调整) */
+    ui->tableView->horizontalHeader()->setFixedHeight(48);
+    /* 设置列宽度固定 */
+    ui->tableView->horizontalHeader()->setSectionResizeMode(QHeaderView::Fixed);
     /* 去掉列标题 */
     ui->tableView->verticalHeader()->setVisible(false);
     /* 去掉网格线 */
@@ -145,17 +154,50 @@ void CompareItemListDialog::initTable()
     ui->tableView->setEditTriggers(QAbstractItemView::NoEditTriggers);
     /* 禁止显示横向滚动条 */
     // ui->tableView->horizontalHeader()->setStretchLastSection(true); /* 设置最后一列拉伸 */
-    ui->tableView->horizontalHeader()->setSectionResizeMode(QHeaderView::Fixed); /* 设置列宽度固定 */
+    
 
     /* 设置固定列宽度 */
     ui->tableView->setColumnWidth(0, 160);  /* 第一列宽度 */
     ui->tableView->setColumnWidth(1, 160);  /* 第二列宽度 */
-    ui->tableView->setColumnWidth(3, 240);  /* 第三列宽度 */
-    ui->tableView->setColumnWidth(4, 280);  /* 第四列宽度 */
-    ui->tableView->setColumnWidth(5, 96);   /* 第五列宽度 */
+    ui->tableView->setColumnWidth(2, 240);  /* 第三列宽度 */
+    ui->tableView->setColumnWidth(3, 280);  /* 第四列宽度 */
+    ui->tableView->setColumnWidth(4, 96);   /* 第五列宽度 */
+
+    /* 测试用,加入两列数据 */
+    for(int i = 0; i < 10; ++i)
+    {
+        CompareItemTableItem_t item;
+        item.nSerialNum = i + 1; /* 序号 */
+        item.nID = i + 1000; /* 对比项ID */
+        item.strName = QString("对比项%1").arg(i + 1); /* 对比项名称 */
+        item.isEnable = (i % 2 == 0); /* 偶数启用,奇数未启用 */
+        item.nChannelCount = i + 1; /* 通道数 */
+
+        addRow(item);
+    }
+}
 
 
-    
+/* 添加一行 */
+void CompareItemListDialog::addRow(CompareItemTableItem_t item)
+{
+    QList<QStandardItem*> items;
+    /* 序号 */
+    QStandardItem* item1 = new QStandardItem(QString::number(item.nSerialNum));
+    item1->setCheckable(true);
+    item1->setCheckState(Qt::Unchecked);
+    items.append(item1); 
+    /* 状态 */
+    QString status = item.isEnable ? "启用" : "未启用";
+    items.append(new QStandardItem(status));
+    /* 对比项 */
+    items.append(new QStandardItem(item.strName));
+    /* 通道数 */
+    items.append(new QStandardItem(QString::number(item.nChannelCount)));
+    /* 操作 */
+    items.append(new QStandardItem("详情"));
+
+    m_model->appendRow(items);
 }
 
 

+ 3 - 1
SettingLibrary/Modules/Basic/compareitemlistdialog.h

@@ -5,7 +5,7 @@
 #include <QSortFilterProxyModel>
 
 #include "DialogBase.h"
-
+#include "GlobalVariable.h"
 
 
 
@@ -55,6 +55,8 @@ private slots:
 private:
     /* 初始化表格 */
     void initTable();
+    /* 添加一行 */
+    void addRow(CompareItemTableItem_t item);
 
 private:
     Ui::CompareItemListWidget *ui;

+ 20 - 0
SettingLibrary/Modules/Basic/singlecompareroadwidget.cpp

@@ -41,3 +41,23 @@ void SingleCompareRoadWidget::setIndex(int nIndex)
     ui->labelDriverNum->setText(QString("<font color='red'>*</font>%1通道声卡设备编号:").arg(str));
     ui->checkBox->setText(QString("%1通道开启录音").arg(str));
 }
+
+/* 获取通道名称 */
+QString SingleCompareRoadWidget::getRoadName() const
+{
+    return ui->lineEditRoadName->text();
+}
+
+/* 获取声卡录音通道编号 */
+int SingleCompareRoadWidget::getSoundCardRoadNum() const
+{
+    /* 声卡要做映射,并取出映射值 */
+    return 0;
+}
+
+/* 是否开启录音 */
+bool SingleCompareRoadWidget::isRecordEnabled() const
+{
+    return ui->checkBox->isChecked();
+}
+

+ 7 - 0
SettingLibrary/Modules/Basic/singlecompareroadwidget.h

@@ -21,8 +21,15 @@ public:
     bool isDelBtnVisible() const;
     void setDelBtnVisible(bool bVisible);
 
+    /* 获取设置编号 */
     int getIndex() const;
     void setIndex(int nIndex);
+    /* 获取通道名称 */
+    QString getRoadName() const;
+    /* 获取声卡录音通道编号 */
+    int getSoundCardRoadNum() const;
+    /* 是否开启录音 */
+    bool isRecordEnabled() const;
 
 signals:
     void deleted(int nIndex);

+ 4 - 4
SettingLibrary/Modules/Basic/singlecompareroadwidget.ui

@@ -6,7 +6,7 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>1134</width>
+    <width>1125</width>
     <height>32</height>
    </rect>
   </property>
@@ -190,16 +190,16 @@ QPushButton#btnDel:hover
        </widget>
       </item>
       <item>
-       <widget class="QLineEdit" name="lineEditDeviceNum">
+       <widget class="QComboBox" name="comboBox_soundCardNum">
         <property name="minimumSize">
          <size>
-          <width>320</width>
+          <width>300</width>
           <height>32</height>
          </size>
         </property>
         <property name="maximumSize">
          <size>
-          <width>320</width>
+          <width>16777215</width>
           <height>32</height>
          </size>
         </property>

+ 2 - 0
SettingLibrary/Resources/QSS.qrc

@@ -4,5 +4,7 @@
         <file>qss/white/dialogbase.qss</file>
         <file>qss/white/basicwidget.qss</file>
         <file>qss/white/compareitemlistwidget.qss</file>
+        <file>qss/white/compareitemwidget.qss</file>
+        <file>qss/white/singlecompareroadwidget.qss</file>
     </qresource>
 </RCC>

+ 27 - 5
SettingLibrary/Resources/qss/white/compareitemlistwidget.qss

@@ -102,10 +102,13 @@ QPushButton#pBtn_add:hover
  *  QTableView
  * ========================================================== */
 
-
+/* QTableView设置 */
 QTableView
 {
-    background: transparent;
+    border: none;
+    background-color: white;
+    selection-background-color: black;
+
     font-weight: 400;
     font-size: 14px;
     color: #3A3F63;
@@ -114,11 +117,30 @@ QTableView
     font-style: normal;
     text-transform: none;
 
-    /* background: #4458FE; */
-    border: 0px solid rgba(255, 255, 255, 0.1);
     outline: none;
 }
 
+/* 标题头整个区域 */
+QHeaderView
+{
+    background:transparent;
+    border-bottom: 1px solid #E6E9F4;
+    border-top: 1px solid #E6E9F4;
+    border-left: none;
+    border-right: none;
+}
+ 
+/*表头设置*/
+QHeaderView::section
+{
+    background: #FFFFFF;
+    color: #3A3F63;
+    font-weight: 400;
+    font-size: 14px;
+    padding-left: 8px;
+    border: none;
+}
+ 
 QTableView::item
 {
     font-weight: 400;
@@ -127,7 +149,7 @@ QTableView::item
     background: transparent;
 
     border: none;
-    padding-left: 12px;
+    padding-left: 8px;
     outline: none;
 }
 

+ 174 - 0
SettingLibrary/Resources/qss/white/compareitemwidget.qss

@@ -0,0 +1,174 @@
+
+
+
+/* ==========================================================
+ *  QWidget
+ * ========================================================== */
+QWidget#widgetContent
+{
+	background: #FFFFFF;
+}
+
+QWidget#widgetMute, #widgetOverload, #widgetPhase
+{
+	border-bottom: 1px solid #E6E9F4;
+}
+
+QWidget#widget
+{
+    background: #FFFFFF;
+    border: none;
+}
+
+/* ==========================================================
+ *  QLabel各个widget的标题
+ * ========================================================== */
+QLabel
+{
+	font-weight: 400;
+	font-size: 14px;
+	color: #3A3F63;
+}
+
+QLabel#labelBase,#label_soundCompute
+{
+	font-weight: 500;
+	font-size: 16px;
+}
+
+QLabel#labelOtherRoad,#labelMute,#labelOverload,#labelPhase
+{
+	font-weight: 500;
+	font-size: 14px;
+}
+
+/* ==========================================================
+ *  添加按钮
+ * ========================================================== */
+
+QPushButton#pBtn_add
+{
+	border-image: url(:/icon/add.png);
+}
+QPushButton#pBtn_add:hover
+{
+	border-image: url(:/icon/add_hover.png);
+}
+
+/* ==========================================================
+ *  QLineEdit
+ * ========================================================== */
+QLineEdit
+{
+	background: #FFFFFF;
+	border-radius: 4px;
+	border: 1px solid #E6E9F4;
+	padding-left: 12px;
+	font-weight: 400;
+	font-size: 14px;
+	color: #3A3F63;
+}
+QLineEdit:hover,QLineEdit:focus
+{
+	border: 1px solid #4458FE;
+}
+
+/* ==========================================================
+ *  QCheckBox开关类型
+ * ========================================================== */
+QCheckBox#checkBoxMute,#checkBoxOverload,#checkBoxPhase
+{
+	font-weight: 400;
+	font-size: 14px;
+	color: #3A3F63;
+}
+QCheckBox#checkBoxMute::indicator,
+#checkBoxOverload::indicator,
+#checkBoxPhase::indicator
+{
+	width: 44px; 
+	height: 22px;
+}
+QCheckBox#checkBoxMute::indicator:unchecked,
+#checkBoxOverload::indicator:unchecked,
+#checkBoxPhase::indicator:unchecked
+{
+	image: url(:/icon/offswitch.png);
+}
+QCheckBox#checkBoxMute::indicator:checked,
+#checkBoxOverload::indicator:checked,
+#checkBoxPhase::indicator:checked
+{
+	image: url(:/icon/onswitch.png);
+}
+
+/* ==========================================================
+ *  QCheckBox普通类型
+ * ========================================================== */
+QCheckBox#checkBox_enable
+{
+	font-weight: 400;
+	font-size: 14px;
+	color: #3A3F63;
+}
+QCheckBox#checkBox_enable::indicator
+{
+	width: 16px; 
+	height: 16px;
+}
+QCheckBox#checkBox_enable::indicator:unchecked
+{
+	image: url(:/icon/unchecked.png);
+}
+QCheckBox#checkBox_enable::indicator:checked
+{
+	image: url(:/icon/checked.png);
+}
+
+
+/* ==========================================================
+ *  QScrollArea
+ * ========================================================== */
+QScrollArea, QWidget#scrollAreaWidgetContents 
+{
+    background: #FFFFFF !important;
+    border: none;
+}
+
+QScrollBar:vertical
+{
+    width: 6px;
+	border:none;
+    background: transparent;
+    margin-right: 0px;
+}
+QScrollBar::add-line:vertical, QScrollBar::sub-line:vertical
+{
+	background: transparent;
+	border: none;
+}
+QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical
+{
+	background: transparent;
+}
+QScrollBar::handle:vertical
+{
+    background: #E2E2E2;
+    border-radius: 1px;
+	margin-right: 1px;
+	margin-left: 1px;
+}
+QScrollBar::handle:vertical:hover
+{
+	background: rgb(234, 234, 234);
+	margin-right: 0px;
+	margin-left: 0px;
+	border-radius: 2px;
+}
+QScrollBar::handle:vertical:pressed
+{
+	background: rgb(234, 234, 234);
+	margin-right: 0px;
+	margin-left: 0px;
+	border-radius: 2px;
+}

+ 2 - 7
SettingLibrary/Resources/qss/white/dialogbase.qss

@@ -9,14 +9,9 @@ QWidget
     text-transform: none;
 }
 
-QWidget#DialogBase
-{
-    background: transparent;
-    border: none;
-}
 
 /* 整体背景 */
-QWidget#widget_background
+QWidget#widget_content__
 {
     background: #FFFFFF;
     border-radius: 8px 8px 8px 8px;
@@ -125,7 +120,7 @@ QPushButton#pBtn_OK:hover
     background: qlineargradient( x0:1,x1:1,y1:0,y2:0,stop:0 #5D73FF,stop:1 #6092FF);
     border-radius: 16px;
 }
-
+/* ------------------------------------------------------- */
 /********* 普通方框按钮三种状态效果 *********/
 /* QPushButton#pBtn_compareItem, #pBtn_restore
 {

+ 168 - 0
SettingLibrary/Resources/qss/white/singlecompareroadwidget.qss

@@ -0,0 +1,168 @@
+QLabel
+{
+	font-weight: 400;
+	font-size: 14px;
+	color: #3A3F63;
+}
+
+
+/* ==========================================================
+ *  QLineEdit
+ * ========================================================== */
+QLineEdit
+{
+	background: #FFFFFF;
+	border-radius: 4px;
+	border: 1px solid #E6E9F4;
+	font-weight: 400;
+	font-size: 14px;
+	color: #3A3F63;
+	padding-left: 12px;
+}
+QLineEdit:hover,QLineEdit:focus
+{
+	border: 1px solid #4458FE;
+}
+
+
+QPushButton#btnDel
+{
+	border-image: url(:/icon/del.png);
+}
+QPushButton#btnDel:hover
+{
+	border-image: url(:/icon/del_hover.png);
+}
+
+
+/* ==========================================================
+ *  QComboBox(这个是在用的)
+ * ========================================================== */
+
+QComboBox:enabled
+{
+    background-color:#FFFFFF;
+    border: 1px solid #E6E9F4;
+    border-radius: 4px;
+    font-size:14px;
+    font-weight: 400;
+    color:#3A3F63;
+    padding-left: 12px;
+}
+
+/* 不能编辑的时候的样式,setEnable(false) */
+QComboBox:!enabled
+{
+    background:rgba(0,0,0,0.04);
+	border: 1px solid #E6E9F4;
+    border-radius: 4px;
+    font-size:14px;
+    font-weight: 400;
+    color:rgba(58,63,99,0.65);
+    padding-left: 12px;
+}
+
+QComboBox:hover
+{
+    border: 1px solid #4458FE;
+    border-radius: 4px;
+    background:transparent;
+}
+
+/* 下拉箭头所在的位置方框 */
+QComboBox::drop-down
+{
+    width: 24px;
+    border: none;
+}
+/* 下拉箭头图标 */
+QComboBox::down-arrow
+{
+    image: url(:/icon/down_arrow.png);
+    height:16px;
+    width:16px;
+}
+
+/* 下拉条样式,就是view,整个下拉窗体的样式 */
+QComboBox QAbstractItemView
+{
+    background-color: #FFFFFF;
+    margin: 12px;
+    outline:0px;
+    font-size:14px;
+    color: #3A3F63;
+    border-radius: 4px;
+}
+
+/* 使下面两句生效,需要加上如下语句 */
+/* m_comBoxDev->setView(new QListView()); */
+QComboBox QAbstractItemView::item
+{
+    background-color: #FFFFFF;
+    border-radius:4px;
+    color: #3A3F63;
+    padding-left: 12px;
+    height: 32px;
+}
+
+QComboBox QAbstractItemView::item:hover
+{
+    border-radius:4px;
+    background-color: #EEF2FF;
+}
+
+/******** combobox 滚动条  *********/
+/*主体部分*/
+QComboBox QScrollBar::vertical
+{ 
+    width:8px;
+    background:transparent;
+    border:none;
+    border-radius:5px;
+}
+/*滑块主体*/
+QComboBox QScrollBar::handle::vertical
+{
+    width: 8px;
+    background: #E2E2E2;
+    border-radius: 3px;
+    min-width: 8px;
+}
+QComboBox QScrollBar::handle::vertical::hover
+{
+    background:transparent;
+}
+/*上箭头*/
+QComboBox QScrollBar::add-line::vertical
+{
+    border:none;
+}
+/*下箭头*/
+QComboBox QScrollBar::sub-line::vertical
+{
+    border:none;
+}
+
+
+/* ==========================================================
+ *  QCheckBox
+ * ========================================================== */
+QCheckBox
+{
+	font-weight: 400;
+	font-size: 14px;
+	color: #3A3F63;
+}
+QCheckBox::indicator
+{
+	width: 16px; 
+	height: 16px;
+}
+QCheckBox::indicator:unchecked
+{
+	image: url(:/icon/unchecked.png);
+}
+QCheckBox::indicator:checked
+{
+	image: url(:/icon/checked.png);
+}

+ 3 - 0
SettingLibrary/common/LHLog/LHLogInit.cpp

@@ -81,12 +81,15 @@ void initLog(QString ModuleName, CLHQLogApi& lhQLog)
         auto logger_webapi = std::make_shared<spdlog::logger>("FromWebAPI",begin(sinks),end(sinks));
         /* 创建一个设置动态库统一的logger */
         auto logger_settings = std::make_shared<spdlog::logger>("ACASetting",begin(sinks),end(sinks));
+        /* 创建一个对比项管理器的logger */
+        auto logger_compareitem = std::make_shared<spdlog::logger>("CompareItemData",begin(sinks),end(sinks));
 
 
         /* 注册到注册表 */
         spdlog::register_logger(logger_main);
         spdlog::register_logger(logger_webapi);
         spdlog::register_logger(logger_settings);
+        spdlog::register_logger(logger_compareitem);
 
 
         /* 设置spdlog输出级别,默认的估计不输出debug这个级别