Przeglądaj źródła

V0.3.6
1、修改了设置动态库

Apple 5 dni temu
rodzic
commit
35ce4a3cbe
39 zmienionych plików z 1005 dodań i 1019 usunięć
  1. 6 2
      CMakeLists.txt
  2. 1 1
      SQL/ACAServer.sql
  3. 1 1
      SQL/ACASetting.sql
  4. 2 0
      SettingLibrary/CMakeLists.txt
  5. 17 4
      SettingLibrary/Modules/AICompare/aicomparewidget.cpp
  6. 2 1
      SettingLibrary/Modules/AICompare/aicomparewidget.h
  7. 20 13
      SettingLibrary/Modules/AICompare/aicomparewidget.ui
  8. 38 10
      SettingLibrary/Modules/Basic/basicwidget.cpp
  9. 7 0
      SettingLibrary/Modules/Basic/basicwidget.h
  10. 13 13
      SettingLibrary/Modules/Basic/basicwidget.ui
  11. 7 0
      SettingLibrary/Modules/CheckPeriod/checkperiodwidget.cpp
  12. 2 0
      SettingLibrary/Modules/CheckPeriod/checkperiodwidget.h
  13. 47 13
      SettingLibrary/Modules/CheckPeriod/checkperiodwidget.ui
  14. 16 7
      SettingLibrary/Modules/Database/databasewidget.cpp
  15. 4 0
      SettingLibrary/Modules/Database/databasewidget.h
  16. 121 114
      SettingLibrary/Modules/Database/databasewidget.ui
  17. 34 30
      SettingLibrary/Modules/Noise/noisemonitorparamdialog.cpp
  18. 1 0
      SettingLibrary/Modules/Noise/noisemonitorparamdialog.h
  19. 423 677
      SettingLibrary/Modules/Noise/noisemonitorparamwidget.ui
  20. 31 8
      SettingLibrary/Modules/Noise/noisewidget.cpp
  21. 3 0
      SettingLibrary/Modules/Noise/noisewidget.h
  22. 20 13
      SettingLibrary/Modules/Noise/noisewidget.ui
  23. 9 0
      SettingLibrary/Resources/qss/white/aicomparewidget.qss
  24. 1 1
      SettingLibrary/Resources/qss/white/basicwidget.qss
  25. 16 1
      SettingLibrary/Resources/qss/white/checkperiodwidget.qss
  26. 1 1
      SettingLibrary/Resources/qss/white/compareitemlistwidget.qss
  27. 15 0
      SettingLibrary/Resources/qss/white/databasewidget.qss
  28. 17 0
      SettingLibrary/Resources/qss/white/noisemonitorparamwidget.qss
  29. 11 0
      SettingLibrary/Resources/qss/white/noisewidget.qss
  30. 1 0
      SettingLibrary/Resources/qss/white/setinfowidget.qss
  31. 2 0
      SettingLibrary/Resources/qss/white/singlecompareroadwidget.qss
  32. 13 0
      SettingLibrary/setinfomanager.cpp
  33. 3 0
      SettingLibrary/setinfomanager.h
  34. 54 61
      SettingLibrary/setinfowidget.cpp
  35. 4 2
      SettingLibrary/setinfowidget.h
  36. 12 6
      SettingLibrary/setinfowidget.ui
  37. 14 20
      common/DataManager/SystemConfig.cpp
  38. 7 10
      common/DataManager/SystemConfigStruct.cpp
  39. 9 10
      common/DataManager/SystemConfigStruct.h

+ 6 - 2
CMakeLists.txt

@@ -190,9 +190,13 @@ file(GLOB GLOBAL_SRC
 #********************  生成可执行程序 ********************
 #=========================================================
 
-
+if(CMAKE_SYSTEM_NAME MATCHES "Linux")
 add_subdirectory(${CMAKE_SOURCE_DIR}/Server)
+add_subdirectory(${CMAKE_SOURCE_DIR}/show3)
+endif(CMAKE_SYSTEM_NAME MATCHES "Linux")
+
+
 add_subdirectory(${CMAKE_SOURCE_DIR}/SettingLibrary)
 add_subdirectory(${CMAKE_SOURCE_DIR}/show2)
-add_subdirectory(${CMAKE_SOURCE_DIR}/show3)
+
 

+ 1 - 1
SQL/ACAServer.sql

@@ -1,4 +1,4 @@
--- Active: 1752718919967@@192.1.2.61@5236
+-- Active: 1751960213665@@192.1.2.61@5236@EQM_CESHI
 
 
 #对比项

+ 1 - 1
SQL/ACASetting.sql

@@ -1,4 +1,4 @@
--- Active: 1749101595433@@192.1.2.61@5236@EQM_CESHI
+-- Active: 1751960213665@@192.1.2.61@5236@EQM_CESHI
 
 
 

+ 2 - 0
SettingLibrary/CMakeLists.txt

@@ -13,6 +13,7 @@ file(GLOB LOCAL_SRC
     ${CMAKE_SOURCE_DIR}/External/common/combox/*.cpp
     ${CMAKE_SOURCE_DIR}/External/common/TipWidget/*.cpp
     ${CMAKE_SOURCE_DIR}/External/common/TipWidget/*.qrc
+    ${CMAKE_SOURCE_DIR}/External/common/commonFunc/*.cpp
     ${CMAKE_SOURCE_DIR}/External/module/mqtt/*.cpp
 
     ${CMAKE_SOURCE_DIR}/common/DataManager/*.cpp
@@ -77,6 +78,7 @@ target_include_directories(${libName} PRIVATE
     ${CMAKE_SOURCE_DIR}/External/common/Thread
     ${CMAKE_SOURCE_DIR}/External/common/combox
     ${CMAKE_SOURCE_DIR}/External/common/TipWidget
+    ${CMAKE_SOURCE_DIR}/External/common/commonFunc
     ${CMAKE_SOURCE_DIR}/External/module
     ${CMAKE_SOURCE_DIR}/External/module/mqtt
     ${CMAKE_SOURCE_DIR}/External/module/nlohmann

+ 17 - 4
SettingLibrary/Modules/AICompare/aicomparewidget.cpp

@@ -22,10 +22,15 @@ AICompareWidget::AICompareWidget(QWidget *parent) :
     /* 设置 lineEdit_length 只能输入数字 */
     ui->lineEdit_length->setValidator(new QIntValidator(1, 120, this));
 
+    /* 隐藏AI对比目录,不需要了 */
+    ui->lineEdit_dir->hide();
+    ui->label_2->hide();
+
     /* 设置初始化的参数 */
-    const AICompareConfig_t &aiConfig = SysConfig.getAICompareConfig();
-    ui->lineEdit_length->setText(QString::number(aiConfig.nAiComputeDuration));
-    ui->lineEdit_dir->setText(aiConfig.strAiCompareDir);
+    do_pBtn_restore_clicked();
+
+    /* 连接信号和槽 */
+    connect(ui->pBtn_restore, &QPushButton::clicked, this, &AICompareWidget::do_pBtn_restore_clicked);
 
     /* 设置样式 */
     UIStyle.registerWidget(this);
@@ -49,7 +54,7 @@ bool AICompareWidget::saveConfig()
     if(aiConfig == oldConfig)
     {
         SPDLOG_LOGGER_DEBUG(m_logger, "AI对比配置没有变化,不需要更新");
-        return false;
+        return true;
     }
 
     /* 将AI对比配置转换成json */
@@ -74,3 +79,11 @@ bool AICompareWidget::saveConfig()
     return true;
 }
 
+
+/* 恢复配置项 */
+void AICompareWidget::do_pBtn_restore_clicked()
+{
+    const AICompareConfig_t &aiConfig = SysConfig.getAICompareConfig();
+    ui->lineEdit_length->setText(QString::number(aiConfig.nAiComputeDuration));
+    ui->lineEdit_dir->setText(aiConfig.strAiCompareDir);
+}

+ 2 - 1
SettingLibrary/Modules/AICompare/aicomparewidget.h

@@ -24,7 +24,8 @@ public:
     bool saveConfig();
 
 private slots:
-    
+    /* 恢复配置项 */
+    void do_pBtn_restore_clicked();
     
 
 private:

+ 20 - 13
SettingLibrary/Modules/AICompare/aicomparewidget.ui

@@ -108,19 +108,6 @@
      </layout>
     </widget>
    </item>
-   <item>
-    <spacer name="verticalSpacer">
-     <property name="orientation">
-      <enum>Qt::Vertical</enum>
-     </property>
-     <property name="sizeHint" stdset="0">
-      <size>
-       <width>20</width>
-       <height>40</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
    <item>
     <widget class="QPushButton" name="pBtn_restore">
      <property name="minimumSize">
@@ -140,6 +127,26 @@
      </property>
     </widget>
    </item>
+   <item>
+    <widget class="QLabel" name="label_tip">
+     <property name="text">
+      <string>可恢复为编辑时的初始字段信息</string>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <spacer name="verticalSpacer">
+     <property name="orientation">
+      <enum>Qt::Vertical</enum>
+     </property>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>20</width>
+       <height>40</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
   </layout>
  </widget>
  <resources/>

+ 38 - 10
SettingLibrary/Modules/Basic/basicwidget.cpp

@@ -57,18 +57,11 @@ BasicWidget::BasicWidget(QWidget *parent) :
     }
 
     /* 设置从数据库读取到的选项 */
-    const BaseConfig_t& baseConfig = SysConfig.getBaseConfigSrc();
-    ui->lineEdit_serverIP->setText(baseConfig.strServerIP);
-    ui->comBox_recordMode->setCurrentIndex(ui->comBox_recordMode->findData(baseConfig.nRecordMode));
-    ui->comBox_driverName->setCurrentText(baseConfig.strDriverName);
-    ui->comBox_notConsistency->setCurrentIndex(ui->comBox_notConsistency->findData(baseConfig.nNotConsistency));
-    ui->checkBox_enableMultiCPU->setChecked(baseConfig.isEnableMultiCore);
-    ui->checkBox_enableDebug->setChecked(baseConfig.isEnableDebugLog);
-    ui->checkBox_clearHistoryDir->setChecked(baseConfig.isClearDirSystemOn);
-    ui->checkBox_enableSoundCardName->setChecked(baseConfig.isUsingSoundCardName);
+    restoreBasicSettingInfo();
 
     /* 连接信号和槽 */
     connect(ui->comBox_driverName, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &BasicWidget::do_soundCardChanged);
+    connect(ui->pBtn_restore, &QPushButton::clicked, this, &BasicWidget::do_pBtn_restore_clicked);
     /* 设置声卡信息 */
     setSoundCardInfo();
     
@@ -127,6 +120,16 @@ void BasicWidget::do_soundCardChanged(int nIndex)
     }
 }
 
+/* 恢复配置项 */
+void BasicWidget::do_pBtn_restore_clicked()
+{
+    /* 从全局设置中恢复已修改的设置 */
+    restoreBasicSettingInfo();
+
+    /* 恢复对比项信息 */
+    restoreCompareItemInfo();
+}
+
 
 /* 设置声卡信息 */
 void BasicWidget::setSoundCardInfo()
@@ -260,7 +263,7 @@ bool BasicWidget::saveCompareItemInfo()
         }
     }
 
-    /* 更新数据库信息 */
+    /* 获取更新后的数据库信息 */
     QList<CompareItemInfo_t> listNewItems;
     if(!m_fromWebAPI->getCompareItemInfo(listNewItems))
     {
@@ -347,4 +350,29 @@ void BasicWidget::findUpdateCompareItem(const QList<CompareItemInfo_t>& srcItems
     }
 }
 
+/* 恢复基础信息 */
+void BasicWidget::restoreBasicSettingInfo()
+{
+    const BaseConfig_t& baseConfig = SysConfig.getBaseConfigSrc();
+    ui->lineEdit_serverIP->setText(baseConfig.strServerIP);
+    ui->comBox_recordMode->setCurrentIndex(ui->comBox_recordMode->findData(baseConfig.nRecordMode));
+    ui->comBox_driverName->setCurrentText(baseConfig.strDriverName);
+    ui->comBox_notConsistency->setCurrentIndex(ui->comBox_notConsistency->findData(baseConfig.nNotConsistency));
+    ui->checkBox_enableMultiCPU->setChecked(baseConfig.isEnableMultiCore);
+    ui->checkBox_enableDebug->setChecked(baseConfig.isEnableDebugLog);
+    ui->checkBox_clearHistoryDir->setChecked(baseConfig.isClearDirSystemOn);
+    ui->checkBox_enableSoundCardName->setChecked(baseConfig.isUsingSoundCardName);
+}
+
+/* 恢复对比项信息 */
+bool BasicWidget::restoreCompareItemInfo()
+{
+    const auto& srcCompareItems = CIData.getSrcCompareItemList();
+
+    /* 恢复对比项信息 */
+    CIData.setCompareItemList(srcCompareItems);
+
+    return true;
+}
+
 

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

@@ -32,6 +32,8 @@ private slots:
     void do_pBtn_CompareItemClicked();
     /* 修改了选择了声卡 */
     void do_soundCardChanged(int nIndex);
+    /* 恢复配置项 */
+    void do_pBtn_restore_clicked();
 
 private:
     /* 设置声卡信息 */
@@ -48,6 +50,11 @@ private:
     void findUpdateCompareItem(const QList<CompareItemInfo_t>& srcItems, const QList<CompareItemInfo_t>& nowItems, 
         QList<CompareItemInfo_t>& baseUpdateItems, QList<CompareItemInfo_t>& roadUpdateItems);
 
+    /* 恢复基础信息 */
+    void restoreBasicSettingInfo();
+    /* 恢复对比项信息 */
+    bool restoreCompareItemInfo();
+
 private:
     Ui::BasicWidget *ui;
     std::shared_ptr<spdlog::logger> m_logger = nullptr;

+ 13 - 13
SettingLibrary/Modules/Basic/basicwidget.ui

@@ -264,19 +264,6 @@
      </layout>
     </widget>
    </item>
-   <item>
-    <spacer name="verticalSpacer">
-     <property name="orientation">
-      <enum>Qt::Vertical</enum>
-     </property>
-     <property name="sizeHint" stdset="0">
-      <size>
-       <width>20</width>
-       <height>40</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
    <item>
     <layout class="QHBoxLayout" name="horizontalLayout">
      <item>
@@ -339,6 +326,19 @@
      </property>
     </widget>
    </item>
+   <item>
+    <spacer name="verticalSpacer">
+     <property name="orientation">
+      <enum>Qt::Vertical</enum>
+     </property>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>20</width>
+       <height>40</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
   </layout>
  </widget>
  <customwidgets>

+ 7 - 0
SettingLibrary/Modules/CheckPeriod/checkperiodwidget.cpp

@@ -51,6 +51,7 @@ CheckPeriodWidget::CheckPeriodWidget(QWidget *parent) :
     connect(ui->checkBox_applyOverload, &QCheckBox::clicked, this, &CheckPeriodWidget::do_checkBox_clicked);
     connect(ui->checkBox_applyPhase, &QCheckBox::clicked, this, &CheckPeriodWidget::do_checkBox_clicked);
     connect(ui->checkBox_applyNoise, &QCheckBox::clicked, this, &CheckPeriodWidget::do_checkBox_clicked);
+    connect(ui->pBtn_restore, &QPushButton::clicked, this, &CheckPeriodWidget::do_pBtn_restore_clicked);
 
     /* 设置UI */
     UIStyle.registerWidget(this);
@@ -446,6 +447,12 @@ void CheckPeriodWidget::do_checkBox_clicked()
     m_currNoDetectApply.isApplyNoise = ui->checkBox_applyNoise->isChecked();
 }
 
+/* 恢复配置项 */
+void CheckPeriodWidget::do_pBtn_restore_clicked()
+{
+    initListWidget();
+}
+
 
 /* 初始化QListWidget */
 void CheckPeriodWidget::initListWidget()

+ 2 - 0
SettingLibrary/Modules/CheckPeriod/checkperiodwidget.h

@@ -60,6 +60,8 @@ private slots:
     /* 修改了静音、反相、过载相关的设置 */
     void do_checkBox_clicked();
 
+    /* 恢复配置项 */
+    void do_pBtn_restore_clicked();
 
 private:
     /* 初始化QListWidget */

+ 47 - 13
SettingLibrary/Modules/CheckPeriod/checkperiodwidget.ui

@@ -291,7 +291,7 @@
            <x>0</x>
            <y>0</y>
            <width>358</width>
-           <height>138</height>
+           <height>110</height>
           </rect>
          </property>
          <layout class="QVBoxLayout" name="verticalLayout_7">
@@ -402,22 +402,56 @@
     </widget>
    </item>
    <item>
-    <widget class="QPushButton" name="pBtn_restore">
+    <widget class="QWidget" name="widget_bottom" native="true">
      <property name="minimumSize">
       <size>
-       <width>102</width>
-       <height>32</height>
-      </size>
-     </property>
-     <property name="maximumSize">
-      <size>
-       <width>102</width>
-       <height>32</height>
+       <width>0</width>
+       <height>60</height>
       </size>
      </property>
-     <property name="text">
-      <string>恢复配置项</string>
-     </property>
+     <layout class="QVBoxLayout" name="verticalLayout_6">
+      <property name="spacing">
+       <number>12</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="QPushButton" name="pBtn_restore">
+        <property name="minimumSize">
+         <size>
+          <width>102</width>
+          <height>32</height>
+         </size>
+        </property>
+        <property name="maximumSize">
+         <size>
+          <width>102</width>
+          <height>32</height>
+         </size>
+        </property>
+        <property name="text">
+         <string>恢复配置项</string>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QLabel" name="label_tip">
+        <property name="text">
+         <string>可恢复为编辑时的初始字段信息</string>
+        </property>
+       </widget>
+      </item>
+     </layout>
     </widget>
    </item>
   </layout>

+ 16 - 7
SettingLibrary/Modules/Database/databasewidget.cpp

@@ -30,14 +30,10 @@ DatabaseWidget::DatabaseWidget(QWidget *parent) :
     ui->lineEdit_listenPort->setValidator(new QIntValidator(1, 65535, this));
 
     /* 获取初始配置 */
-    m_databaseConfig = SysConfig.getDatabaseConfig();
-    ui->lineEdit_recordLogRetain->setText(QString::number(m_databaseConfig.nRecordLogRetain));
-    ui->lineEdit_operatorLOgRetain->setText(QString::number(m_databaseConfig.nOperatorLogRetain));
-    ui->lineEdit_recordFileRetain->setText(QString::number(m_databaseConfig.nRecordFileRetain));
-    ui->lineEdit_clientPort->setText(QString::number(m_databaseConfig.nClientPort));
-    ui->lineEdit_listenPort->setText(QString::number(m_databaseConfig.nListenPort));
-    ui->lineEdit_recordFilePath->setText(m_databaseConfig.strRecordFilePath);
+    do_pBtn_restore_clicked();
     
+    /* 连接信号和槽 */
+    connect(ui->btnRestore, &QPushButton::clicked, this, &DatabaseWidget::do_pBtn_restore_clicked);
 
     UIStyle.registerWidget(this);
 }
@@ -88,3 +84,16 @@ bool DatabaseWidget::saveParams()
     return true;
 }
 
+
+/* 恢复配置项 */
+void DatabaseWidget::do_pBtn_restore_clicked()
+{
+    m_databaseConfig = SysConfig.getDatabaseConfig();
+    ui->lineEdit_recordLogRetain->setText(QString::number(m_databaseConfig.nRecordLogRetain));
+    ui->lineEdit_operatorLOgRetain->setText(QString::number(m_databaseConfig.nOperatorLogRetain));
+    ui->lineEdit_recordFileRetain->setText(QString::number(m_databaseConfig.nRecordFileRetain));
+    ui->lineEdit_clientPort->setText(QString::number(m_databaseConfig.nClientPort));
+    ui->lineEdit_listenPort->setText(QString::number(m_databaseConfig.nListenPort));
+    ui->lineEdit_recordFilePath->setText(m_databaseConfig.strRecordFilePath);
+}
+

+ 4 - 0
SettingLibrary/Modules/Database/databasewidget.h

@@ -24,6 +24,10 @@ public:
     /* 保存参数 */
     bool saveParams();
 
+private slots:
+    /* 恢复配置项 */
+    void do_pBtn_restore_clicked();
+
 private:
     Ui::DatabaseWidget *ui;
     std::shared_ptr<spdlog::logger> m_logger = nullptr;

+ 121 - 114
SettingLibrary/Modules/Database/databasewidget.ui

@@ -62,8 +62,8 @@
       <property name="verticalSpacing">
        <number>16</number>
       </property>
-      <item row="3" column="1">
-       <widget class="QLineEdit" name="lineEdit_clientPort">
+      <item row="4" column="1">
+       <widget class="QLineEdit" name="lineEdit_listenPort">
         <property name="minimumSize">
          <size>
           <width>172</width>
@@ -88,24 +88,31 @@
         </property>
        </widget>
       </item>
-      <item row="5" column="1">
-       <widget class="QLineEdit" name="lineEdit_recordFilePath">
+      <item row="0" column="0">
+       <widget class="QLabel" name="label_2">
+        <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 row="2" column="2">
+       <widget class="QLabel" name="label_11">
         <property name="minimumSize">
          <size>
-          <width>172</width>
-          <height>32</height>
+          <width>60</width>
+          <height>0</height>
          </size>
         </property>
-        <property name="maximumSize">
-         <size>
-          <width>232</width>
-          <height>32</height>
-         </size>
+        <property name="text">
+         <string>(1~24)</string>
         </property>
        </widget>
       </item>
-      <item row="1" column="1">
-       <widget class="QLineEdit" name="lineEdit_operatorLOgRetain">
+      <item row="2" column="1">
+       <widget class="QLineEdit" name="lineEdit_recordFileRetain">
         <property name="minimumSize">
          <size>
           <width>172</width>
@@ -120,21 +127,18 @@
         </property>
        </widget>
       </item>
-      <item row="4" column="1">
-       <widget class="QLineEdit" name="lineEdit_listenPort">
-        <property name="minimumSize">
-         <size>
-          <width>172</width>
-          <height>32</height>
-         </size>
+      <item row="3" column="2">
+       <spacer name="horizontalSpacer_3">
+        <property name="orientation">
+         <enum>Qt::Horizontal</enum>
         </property>
-        <property name="maximumSize">
+        <property name="sizeHint" stdset="0">
          <size>
-          <width>232</width>
-          <height>32</height>
+          <width>40</width>
+          <height>20</height>
          </size>
         </property>
-       </widget>
+       </spacer>
       </item>
       <item row="4" column="0">
        <widget class="QLabel" name="label_5">
@@ -146,18 +150,31 @@
         </property>
        </widget>
       </item>
-      <item row="5" column="0">
-       <widget class="QLabel" name="label_7">
+      <item row="2" column="0">
+       <widget class="QLabel" name="label_4">
         <property name="text">
-         <string>&lt;font color = #D21F21 &gt;*&lt;/font&gt;录音文件目录:</string>
+         <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 row="2" column="1">
-       <widget class="QLineEdit" name="lineEdit_recordFileRetain">
+      <item row="0" column="2">
+       <widget class="QLabel" name="label_10">
+        <property name="minimumSize">
+         <size>
+          <width>60</width>
+          <height>0</height>
+         </size>
+        </property>
+        <property name="text">
+         <string>(1~360)</string>
+        </property>
+       </widget>
+      </item>
+      <item row="1" column="1">
+       <widget class="QLineEdit" name="lineEdit_operatorLOgRetain">
         <property name="minimumSize">
          <size>
           <width>172</width>
@@ -172,35 +189,37 @@
         </property>
        </widget>
       </item>
-      <item row="0" column="0">
-       <widget class="QLabel" name="label_2">
-        <property name="text">
-         <string>&lt;font color = #D21F21 &gt;*&lt;/font&gt;录音日志保留:</string>
+      <item row="6" column="0">
+       <widget class="QPushButton" name="btnRestore">
+        <property name="minimumSize">
+         <size>
+          <width>102</width>
+          <height>32</height>
+         </size>
         </property>
-        <property name="alignment">
-         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+        <property name="maximumSize">
+         <size>
+          <width>102</width>
+          <height>32</height>
+         </size>
         </property>
-       </widget>
-      </item>
-      <item row="2" column="0">
-       <widget class="QLabel" name="label_4">
         <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>
+         <string>恢复配置项</string>
         </property>
        </widget>
       </item>
-      <item row="3" column="0">
-       <widget class="QLabel" name="label_6">
-        <property name="text">
-         <string>&lt;font color = #D21F21 &gt;*&lt;/font&gt;客户端通讯端口:</string>
+      <item row="4" column="2">
+       <spacer name="horizontalSpacer_2">
+        <property name="orientation">
+         <enum>Qt::Horizontal</enum>
         </property>
-        <property name="alignment">
-         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+        <property name="sizeHint" stdset="0">
+         <size>
+          <width>40</width>
+          <height>20</height>
+         </size>
         </property>
-       </widget>
+       </spacer>
       </item>
       <item row="5" column="2">
        <spacer name="horizontalSpacer">
@@ -215,34 +234,44 @@
         </property>
        </spacer>
       </item>
-      <item row="1" column="2">
-       <widget class="QLabel" name="label">
+      <item row="5" column="0">
+       <widget class="QLabel" name="label_7">
+        <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 row="0" column="1">
+       <widget class="QLineEdit" name="lineEdit_recordLogRetain">
         <property name="minimumSize">
          <size>
-          <width>60</width>
-          <height>0</height>
+          <width>172</width>
+          <height>32</height>
          </size>
         </property>
-        <property name="text">
-         <string>(1~360)</string>
+        <property name="maximumSize">
+         <size>
+          <width>232</width>
+          <height>32</height>
+         </size>
         </property>
        </widget>
       </item>
-      <item row="4" column="2">
-       <spacer name="horizontalSpacer_2">
-        <property name="orientation">
-         <enum>Qt::Horizontal</enum>
+      <item row="3" column="0">
+       <widget class="QLabel" name="label_6">
+        <property name="text">
+         <string>&lt;font color = #D21F21 &gt;*&lt;/font&gt;客户端通讯端口:</string>
         </property>
-        <property name="sizeHint" stdset="0">
-         <size>
-          <width>40</width>
-          <height>20</height>
-         </size>
+        <property name="alignment">
+         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
         </property>
-       </spacer>
+       </widget>
       </item>
-      <item row="0" column="1">
-       <widget class="QLineEdit" name="lineEdit_recordLogRetain">
+      <item row="3" column="1">
+       <widget class="QLineEdit" name="lineEdit_clientPort">
         <property name="minimumSize">
          <size>
           <width>172</width>
@@ -257,21 +286,24 @@
         </property>
        </widget>
       </item>
-      <item row="0" column="2">
-       <widget class="QLabel" name="label_10">
+      <item row="5" column="1">
+       <widget class="QLineEdit" name="lineEdit_recordFilePath">
         <property name="minimumSize">
          <size>
-          <width>60</width>
-          <height>0</height>
+          <width>172</width>
+          <height>32</height>
          </size>
         </property>
-        <property name="text">
-         <string>(1~360)</string>
+        <property name="maximumSize">
+         <size>
+          <width>232</width>
+          <height>32</height>
+         </size>
         </property>
        </widget>
       </item>
-      <item row="2" column="2">
-       <widget class="QLabel" name="label_11">
+      <item row="1" column="2">
+       <widget class="QLabel" name="label">
         <property name="minimumSize">
          <size>
           <width>60</width>
@@ -279,58 +311,33 @@
          </size>
         </property>
         <property name="text">
-         <string>(1~24)</string>
+         <string>(1~360)</string>
         </property>
        </widget>
       </item>
-      <item row="3" column="2">
-       <spacer name="horizontalSpacer_3">
+      <item row="8" column="0" colspan="3">
+       <spacer name="verticalSpacer">
         <property name="orientation">
-         <enum>Qt::Horizontal</enum>
+         <enum>Qt::Vertical</enum>
         </property>
         <property name="sizeHint" stdset="0">
          <size>
-          <width>40</width>
-          <height>20</height>
+          <width>20</width>
+          <height>40</height>
          </size>
         </property>
        </spacer>
       </item>
+      <item row="7" column="0" colspan="3">
+       <widget class="QLabel" name="label_tip">
+        <property name="text">
+         <string>可恢复为编辑时的初始字段信息</string>
+        </property>
+       </widget>
+      </item>
      </layout>
     </widget>
    </item>
-   <item>
-    <spacer name="verticalSpacer">
-     <property name="orientation">
-      <enum>Qt::Vertical</enum>
-     </property>
-     <property name="sizeHint" stdset="0">
-      <size>
-       <width>20</width>
-       <height>40</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
-   <item>
-    <widget class="QPushButton" name="btnRestore">
-     <property name="minimumSize">
-      <size>
-       <width>102</width>
-       <height>32</height>
-      </size>
-     </property>
-     <property name="maximumSize">
-      <size>
-       <width>102</width>
-       <height>32</height>
-      </size>
-     </property>
-     <property name="text">
-      <string>恢复配置项</string>
-     </property>
-    </widget>
-   </item>
   </layout>
  </widget>
  <resources/>

+ 34 - 30
SettingLibrary/Modules/Noise/noisemonitorparamdialog.cpp

@@ -3,7 +3,11 @@
 
 #include <QFile>
 #include <QIntValidator>
+#include <QRegexp>
+#include <QRegExpValidator>
+
 #include "UIStyleManager.h"
+#include "commonFunc.h"
 
 
 NoiseMonitorParamDialog::NoiseMonitorParamDialog(QWidget *parent) :
@@ -25,18 +29,23 @@ NoiseMonitorParamDialog::NoiseMonitorParamDialog(QWidget *parent) :
     setTitle("噪音监测参数");
 
     /* 设置lineEdit输入限制 */
+    ui->lineEdit_noiseOneDetectDuration->setValidator(new QIntValidator(1, 60, this));
     ui->lineEdit_noiseDetectContinueCount->setValidator(new QIntValidator(1, 100, this));
     ui->lineEdit_noiseContinueCountIsWarn->setValidator(new QIntValidator(1, 10, this));
     ui->lineEdit_noiseContinueCountPercent->setValidator(new QIntValidator(1, 100, this));
-    ui->lineEdit_freqComponentMini->setValidator(new QIntValidator(this));
-    ui->lineEdit_freqComponentMax->setValidator(new QIntValidator(this));
-    ui->lineEdit_oneDBThreshold->setValidator(new QDoubleValidator(0.0, 1.0, 2, this));
-    ui->lineEdit_oneDBComponentMini->setValidator(new QIntValidator(-30, 30, this));
-    ui->lineEdit_noiseThreahold->setValidator(new QDoubleValidator(0.0, 1.0, 2, this));
-    ui->lineEdit_noiseComponentMini->setValidator(new QIntValidator(-30, 30, this));
-    ui->lineEdit_noiseDetectDuration->setValidator(new QIntValidator(this));
-    ui->lineEdit_noiseDetectPercent->setValidator(new QIntValidator(1, 100, this));
-    ui->lineEdit_noiseDBMax->setValidator(new QIntValidator(this));
+
+    /* 限制小数的正则表达式,0.0-1.0,小数点后6位 */
+    QRegExp regExp1(R"(^(0\.\d{1,6})|(1\.0{0,6})?$)");
+    QRegExpValidator* validator = new QRegExpValidator(regExp1, this);
+    ui->lineEdit_thresholdSlient->setValidator(validator);
+
+    ui->lineEdit_thresholdDB->setValidator(new StrictDoubleValidator(-100, 0, 2, this));
+    ui->lineEdit_thresholdCV->setValidator(new StrictDoubleValidator(-100, 0, 2, this));
+
+
+    ui->lineEdit_nperseg->setValidator(new QIntValidator(1, 4096, this));
+    ui->lineEdit_noverlap->setValidator(new QIntValidator(0, 4096, this));
+    ui->lineEdit_nfft->setValidator(new QIntValidator(1, 4096, this));
 
 
     /* 设置qss */
@@ -53,19 +62,18 @@ void NoiseMonitorParamDialog::setInitialParams(NoiseDetectParam_t& noiseDetectPa
 {
     m_noiseDetectParam = noiseDetectParam;
     /* 设置初始参数到界面 */
-    ui->lineEdit_registCode->setText(noiseDetectParam.strRegitrationCode);
+    ui->lineEdit_noiseOneDetectDuration->setText(QString::number(noiseDetectParam.nNoiseOneDetectDuration));
     ui->lineEdit_noiseDetectContinueCount->setText(QString::number(noiseDetectParam.nNoiseDetectContinueCount));
     ui->lineEdit_noiseContinueCountIsWarn->setText(QString::number(noiseDetectParam.nNoiseContinueCountIsWarn));
     ui->lineEdit_noiseContinueCountPercent->setText(QString::number(noiseDetectParam.nNoiseContinueCountPercent));
-    ui->lineEdit_freqComponentMini->setText(QString::number(noiseDetectParam.nFreqComponentMini));
-    ui->lineEdit_freqComponentMax->setText(QString::number(noiseDetectParam.nFreqComponentMax));
-    ui->lineEdit_oneDBThreshold->setText(QString::number(noiseDetectParam.fOneDBThreshold));
-    ui->lineEdit_oneDBComponentMini->setText(QString::number(noiseDetectParam.nOneDBComponentMini));
-    ui->lineEdit_noiseThreahold->setText(QString::number(noiseDetectParam.fNoiseThreshold));
-    ui->lineEdit_noiseComponentMini->setText(QString::number(noiseDetectParam.nNoiseComponentMini));
-    ui->lineEdit_noiseDetectDuration->setText(QString::number(noiseDetectParam.nNoiseDetectDuration));
-    ui->lineEdit_noiseDetectPercent->setText(QString::number(noiseDetectParam.nNoiseDetectPercent));
-    ui->lineEdit_noiseDBMax->setText(QString::number(noiseDetectParam.nNoiseDBMax));
+
+    ui->lineEdit_thresholdSlient->setText(QString::number(noiseDetectParam.dThresholdSlient));
+    ui->lineEdit_thresholdDB->setText(QString::number(noiseDetectParam.dThresholdDB));
+    ui->lineEdit_thresholdCV->setText(QString::number(noiseDetectParam.dThresholdCV));
+    
+    ui->lineEdit_nperseg->setText(QString::number(noiseDetectParam.nPerseg));
+    ui->lineEdit_noverlap->setText(QString::number(noiseDetectParam.nOverlap));
+    ui->lineEdit_nfft->setText(QString::number(noiseDetectParam.nFFT));
 }
 
 
@@ -95,19 +103,15 @@ bool NoiseMonitorParamDialog::isOKClicked()
 /* 更新噪音检测参数 */
 void NoiseMonitorParamDialog::updateNoiseDetectParam()
 {
-    m_noiseDetectParam.strRegitrationCode = ui->lineEdit_registCode->text();
+    m_noiseDetectParam.nNoiseOneDetectDuration = ui->lineEdit_noiseOneDetectDuration->text().toInt();
     m_noiseDetectParam.nNoiseDetectContinueCount = ui->lineEdit_noiseDetectContinueCount->text().toInt();
     m_noiseDetectParam.nNoiseContinueCountIsWarn = ui->lineEdit_noiseContinueCountIsWarn->text().toInt();
     m_noiseDetectParam.nNoiseContinueCountPercent = ui->lineEdit_noiseContinueCountPercent->text().toInt();
-    m_noiseDetectParam.nFreqComponentMini = ui->lineEdit_freqComponentMini->text().toInt();
-    m_noiseDetectParam.nFreqComponentMax = ui->lineEdit_freqComponentMax->text().toInt();
-    m_noiseDetectParam.fOneDBThreshold = ui->lineEdit_oneDBThreshold->text().toFloat();
-    m_noiseDetectParam.nOneDBComponentMini = ui->lineEdit_oneDBComponentMini->text().toInt();
-    m_noiseDetectParam.fNoiseThreshold = ui->lineEdit_noiseThreahold->text().toFloat();
-    m_noiseDetectParam.nNoiseComponentMini = ui->lineEdit_noiseComponentMini->text().toInt();
-    m_noiseDetectParam.nNoiseDetectDuration = ui->lineEdit_noiseDetectDuration->text().toInt();
-    m_noiseDetectParam.nNoiseDetectPercent = ui->lineEdit_noiseDetectPercent->text().toInt();
-    m_noiseDetectParam.nNoiseDBMax = ui->lineEdit_noiseDBMax->text().toInt();
-
+    m_noiseDetectParam.dThresholdSlient = ui->lineEdit_thresholdSlient->text().toDouble();
+    m_noiseDetectParam.dThresholdDB = ui->lineEdit_thresholdDB->text().toDouble();
+    m_noiseDetectParam.dThresholdCV = ui->lineEdit_thresholdCV->text().toDouble();
+    m_noiseDetectParam.nPerseg = ui->lineEdit_nperseg->text().toInt();
+    m_noiseDetectParam.nOverlap = ui->lineEdit_noverlap->text().toInt();
+    m_noiseDetectParam.nFFT = ui->lineEdit_nfft->text().toInt();
 }
 

+ 1 - 0
SettingLibrary/Modules/Noise/noisemonitorparamdialog.h

@@ -6,6 +6,7 @@
 #include "SystemConfigStruct.h"
 
 
+
 namespace Ui {
 class NoiseMonitorParamWidget;
 }

+ 423 - 677
SettingLibrary/Modules/Noise/noisemonitorparamwidget.ui

@@ -33,688 +33,434 @@
     <number>0</number>
    </property>
    <property name="bottomMargin">
-    <number>0</number>
+    <number>24</number>
    </property>
    <item>
     <widget class="QWidget" name="widgetContent" native="true">
-     <widget class="QLabel" name="label">
-      <property name="geometry">
-       <rect>
-        <x>32</x>
-        <y>32</y>
-        <width>64</width>
-        <height>16</height>
-       </rect>
-      </property>
-      <property name="text">
-       <string>监测信息</string>
-      </property>
-     </widget>
-     <widget class="QLabel" name="label_2">
-      <property name="geometry">
-       <rect>
-        <x>32</x>
-        <y>64</y>
-        <width>176</width>
-        <height>32</height>
-       </rect>
-      </property>
-      <property name="minimumSize">
-       <size>
-        <width>0</width>
-        <height>0</height>
-       </size>
-      </property>
-      <property name="maximumSize">
-       <size>
-        <width>16777215</width>
-        <height>16777215</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>
-     <widget class="QLineEdit" name="lineEdit_registCode">
-      <property name="geometry">
-       <rect>
-        <x>208</x>
-        <y>64</y>
-        <width>208</width>
-        <height>32</height>
-       </rect>
-      </property>
-     </widget>
-     <widget class="QLineEdit" name="lineEdit_noiseContinueCountIsWarn">
-      <property name="geometry">
-       <rect>
-        <x>208</x>
-        <y>112</y>
-        <width>208</width>
-        <height>32</height>
-       </rect>
-      </property>
-     </widget>
-     <widget class="QLabel" name="label_3">
-      <property name="geometry">
-       <rect>
-        <x>32</x>
-        <y>112</y>
-        <width>176</width>
-        <height>32</height>
-       </rect>
-      </property>
-      <property name="minimumSize">
-       <size>
-        <width>0</width>
-        <height>0</height>
-       </size>
-      </property>
-      <property name="maximumSize">
-       <size>
-        <width>16777215</width>
-        <height>16777215</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>
-     <widget class="QLineEdit" name="lineEdit_noiseDetectContinueCount">
-      <property name="geometry">
-       <rect>
-        <x>694</x>
-        <y>64</y>
-        <width>208</width>
-        <height>32</height>
-       </rect>
-      </property>
-     </widget>
-     <widget class="QLabel" name="label_4">
-      <property name="geometry">
-       <rect>
-        <x>504</x>
-        <y>64</y>
-        <width>190</width>
-        <height>32</height>
-       </rect>
-      </property>
-      <property name="minimumSize">
-       <size>
-        <width>0</width>
-        <height>0</height>
-       </size>
-      </property>
-      <property name="maximumSize">
-       <size>
-        <width>16777215</width>
-        <height>16777215</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>
-     <widget class="QLineEdit" name="lineEdit_noiseContinueCountPercent">
-      <property name="geometry">
-       <rect>
-        <x>694</x>
-        <y>112</y>
-        <width>208</width>
-        <height>32</height>
-       </rect>
-      </property>
-     </widget>
-     <widget class="QLabel" name="label_5">
-      <property name="geometry">
-       <rect>
-        <x>504</x>
-        <y>112</y>
-        <width>190</width>
-        <height>32</height>
-       </rect>
-      </property>
-      <property name="minimumSize">
-       <size>
-        <width>0</width>
-        <height>0</height>
-       </size>
-      </property>
-      <property name="maximumSize">
-       <size>
-        <width>16777215</width>
-        <height>16777215</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>
-     <widget class="QLineEdit" name="lineEdit_freqComponentMini">
-      <property name="geometry">
-       <rect>
-        <x>208</x>
-        <y>208</y>
-        <width>208</width>
-        <height>32</height>
-       </rect>
-      </property>
-     </widget>
-     <widget class="QLabel" name="label_6">
-      <property name="geometry">
-       <rect>
-        <x>32</x>
-        <y>208</y>
-        <width>176</width>
-        <height>32</height>
-       </rect>
-      </property>
-      <property name="minimumSize">
-       <size>
-        <width>0</width>
-        <height>0</height>
-       </size>
-      </property>
-      <property name="maximumSize">
-       <size>
-        <width>16777215</width>
-        <height>16777215</height>
-       </size>
-      </property>
-      <property name="text">
-       <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; color:#d21f21;&quot;&gt;*&lt;/span&gt;频率分量最小值:&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
-      </property>
-      <property name="alignment">
-       <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-      </property>
-     </widget>
-     <widget class="QLineEdit" name="lineEdit_freqComponentMax">
-      <property name="geometry">
-       <rect>
-        <x>694</x>
-        <y>208</y>
-        <width>208</width>
-        <height>32</height>
-       </rect>
-      </property>
-     </widget>
-     <widget class="QLabel" name="label_7">
-      <property name="geometry">
-       <rect>
-        <x>504</x>
-        <y>208</y>
-        <width>190</width>
-        <height>32</height>
-       </rect>
-      </property>
-      <property name="minimumSize">
-       <size>
-        <width>0</width>
-        <height>0</height>
-       </size>
-      </property>
-      <property name="maximumSize">
-       <size>
-        <width>16777215</width>
-        <height>16777215</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>
-     <widget class="QLabel" name="label_8">
-      <property name="geometry">
-       <rect>
-        <x>32</x>
-        <y>176</y>
-        <width>250</width>
-        <height>16</height>
-       </rect>
-      </property>
-      <property name="text">
-       <string>分析频率分量的范围 (单位Hz)</string>
-      </property>
-     </widget>
-     <widget class="QLineEdit" name="lineEdit_oneDBComponentMini">
-      <property name="geometry">
-       <rect>
-        <x>694</x>
-        <y>304</y>
-        <width>208</width>
-        <height>32</height>
-       </rect>
-      </property>
-     </widget>
-     <widget class="QLabel" name="label_9">
-      <property name="geometry">
-       <rect>
-        <x>32</x>
-        <y>272</y>
-        <width>250</width>
-        <height>16</height>
-       </rect>
-      </property>
-      <property name="text">
-       <string>单音(正弦、方波、锯齿波等)</string>
-      </property>
-     </widget>
-     <widget class="QLabel" name="label_10">
-      <property name="geometry">
-       <rect>
-        <x>32</x>
-        <y>304</y>
-        <width>176</width>
-        <height>32</height>
-       </rect>
-      </property>
-      <property name="minimumSize">
-       <size>
-        <width>0</width>
-        <height>0</height>
-       </size>
-      </property>
-      <property name="maximumSize">
-       <size>
-        <width>16777215</width>
-        <height>16777215</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>
-     <widget class="QLineEdit" name="lineEdit_oneDBThreshold">
-      <property name="geometry">
-       <rect>
-        <x>208</x>
-        <y>304</y>
-        <width>208</width>
-        <height>32</height>
-       </rect>
-      </property>
-     </widget>
-     <widget class="QLabel" name="label_11">
-      <property name="geometry">
-       <rect>
-        <x>504</x>
-        <y>304</y>
-        <width>190</width>
-        <height>32</height>
-       </rect>
-      </property>
-      <property name="minimumSize">
-       <size>
-        <width>0</width>
-        <height>0</height>
-       </size>
-      </property>
-      <property name="maximumSize">
-       <size>
-        <width>16777215</width>
-        <height>16777215</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>
-     <widget class="QLineEdit" name="lineEdit_noiseComponentMini">
-      <property name="geometry">
-       <rect>
-        <x>694</x>
-        <y>400</y>
-        <width>208</width>
-        <height>32</height>
-       </rect>
-      </property>
-     </widget>
-     <widget class="QLabel" name="label_12">
-      <property name="geometry">
-       <rect>
-        <x>504</x>
-        <y>400</y>
-        <width>190</width>
-        <height>32</height>
-       </rect>
-      </property>
-      <property name="minimumSize">
-       <size>
-        <width>0</width>
-        <height>0</height>
-       </size>
-      </property>
-      <property name="maximumSize">
-       <size>
-        <width>16777215</width>
-        <height>16777215</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>
-     <widget class="QLineEdit" name="lineEdit_noiseThreahold">
-      <property name="geometry">
-       <rect>
-        <x>208</x>
-        <y>400</y>
-        <width>208</width>
-        <height>32</height>
-       </rect>
-      </property>
-     </widget>
-     <widget class="QLabel" name="label_13">
-      <property name="geometry">
-       <rect>
-        <x>32</x>
-        <y>400</y>
-        <width>176</width>
-        <height>32</height>
-       </rect>
-      </property>
-      <property name="minimumSize">
-       <size>
-        <width>0</width>
-        <height>0</height>
-       </size>
-      </property>
-      <property name="maximumSize">
-       <size>
-        <width>16777215</width>
-        <height>16777215</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>
-     <widget class="QLabel" name="label_14">
-      <property name="geometry">
-       <rect>
-        <x>32</x>
-        <y>368</y>
-        <width>250</width>
-        <height>16</height>
-       </rect>
-      </property>
-      <property name="text">
-       <string>噪声(白噪、分红噪、布朗噪等)</string>
-      </property>
-     </widget>
-     <widget class="QPushButton" name="pBtn_defaultSetting">
-      <property name="geometry">
-       <rect>
-        <x>209</x>
-        <y>448</y>
-        <width>88</width>
-        <height>32</height>
-       </rect>
-      </property>
-      <property name="text">
-       <string>默认设置</string>
-      </property>
-     </widget>
-     <widget class="QLabel" name="label_15">
-      <property name="geometry">
-       <rect>
-        <x>308</x>
-        <y>448</y>
-        <width>600</width>
-        <height>32</height>
-       </rect>
-      </property>
-      <property name="text">
-       <string>使用较小噪音系数(漏报减少,误报率加大),使用较大嗓音系数(误报减少,漏报率加大)</string>
-      </property>
-     </widget>
-     <widget class="QLineEdit" name="lineEdit_noiseDetectPercent">
-      <property name="geometry">
-       <rect>
-        <x>694</x>
-        <y>544</y>
-        <width>208</width>
-        <height>32</height>
-       </rect>
-      </property>
-     </widget>
-     <widget class="QLabel" name="label_16">
-      <property name="geometry">
-       <rect>
-        <x>32</x>
-        <y>544</y>
-        <width>176</width>
-        <height>32</height>
-       </rect>
-      </property>
-      <property name="minimumSize">
-       <size>
-        <width>0</width>
-        <height>0</height>
-       </size>
-      </property>
-      <property name="maximumSize">
-       <size>
-        <width>16777215</width>
-        <height>16777215</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>
-     <widget class="QLabel" name="label_17">
-      <property name="geometry">
-       <rect>
-        <x>32</x>
-        <y>512</y>
-        <width>232</width>
-        <height>16</height>
-       </rect>
-      </property>
-      <property name="text">
-       <string>基础噪音判断</string>
-      </property>
-     </widget>
-     <widget class="QLineEdit" name="lineEdit_noiseDetectDuration">
-      <property name="geometry">
-       <rect>
-        <x>208</x>
-        <y>544</y>
-        <width>208</width>
-        <height>32</height>
-       </rect>
-      </property>
-     </widget>
-     <widget class="QLabel" name="label_18">
-      <property name="geometry">
-       <rect>
-        <x>504</x>
-        <y>544</y>
-        <width>190</width>
-        <height>32</height>
-       </rect>
-      </property>
-      <property name="minimumSize">
-       <size>
-        <width>0</width>
-        <height>0</height>
-       </size>
-      </property>
-      <property name="maximumSize">
-       <size>
-        <width>16777215</width>
-        <height>16777215</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>
-     <widget class="QLineEdit" name="lineEdit_noiseDBMax">
-      <property name="geometry">
-       <rect>
-        <x>208</x>
-        <y>592</y>
-        <width>208</width>
-        <height>32</height>
-       </rect>
-      </property>
-     </widget>
-     <widget class="QLabel" name="label_19">
-      <property name="geometry">
-       <rect>
-        <x>32</x>
-        <y>592</y>
-        <width>176</width>
-        <height>32</height>
-       </rect>
-      </property>
-      <property name="minimumSize">
-       <size>
-        <width>0</width>
-        <height>0</height>
-       </size>
-      </property>
-      <property name="maximumSize">
-       <size>
-        <width>16777215</width>
-        <height>16777215</height>
-       </size>
-      </property>
-      <property name="text">
-       <string>&lt;font color = #D21F21 &gt;*&lt;/font&gt;噪音最大DB值:</string>
-      </property>
-      <property name="alignment">
-       <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-      </property>
-     </widget>
-     <widget class="QLabel" name="label_20">
-      <property name="geometry">
-       <rect>
-        <x>906</x>
-        <y>64</y>
-        <width>70</width>
-        <height>32</height>
-       </rect>
-      </property>
-      <property name="text">
-       <string>(1~100)</string>
-      </property>
-     </widget>
-     <widget class="QLabel" name="label_21">
-      <property name="geometry">
-       <rect>
-        <x>420</x>
-        <y>304</y>
-        <width>70</width>
-        <height>32</height>
-       </rect>
-      </property>
-      <property name="text">
-       <string>(0.0~1.0)</string>
-      </property>
-     </widget>
-     <widget class="QLabel" name="label_22">
-      <property name="geometry">
-       <rect>
-        <x>420</x>
-        <y>400</y>
-        <width>70</width>
-        <height>32</height>
-       </rect>
-      </property>
-      <property name="text">
-       <string>(0.0~1.0)</string>
-      </property>
-     </widget>
-     <widget class="QLabel" name="label_23">
-      <property name="geometry">
-       <rect>
-        <x>906</x>
-        <y>112</y>
-        <width>70</width>
-        <height>32</height>
-       </rect>
-      </property>
-      <property name="text">
-       <string>(1~100)%</string>
-      </property>
-     </widget>
-     <widget class="QLabel" name="label_24">
-      <property name="geometry">
-       <rect>
-        <x>906</x>
-        <y>304</y>
-        <width>70</width>
-        <height>32</height>
-       </rect>
-      </property>
-      <property name="text">
-       <string>(-30~30)</string>
-      </property>
-     </widget>
-     <widget class="QLabel" name="label_25">
-      <property name="geometry">
-       <rect>
-        <x>906</x>
-        <y>400</y>
-        <width>70</width>
-        <height>32</height>
-       </rect>
-      </property>
-      <property name="text">
-       <string>(-30~30)</string>
-      </property>
-     </widget>
-     <widget class="QLabel" name="label_26">
-      <property name="geometry">
-       <rect>
-        <x>906</x>
-        <y>544</y>
-        <width>70</width>
-        <height>32</height>
-       </rect>
-      </property>
-      <property name="text">
-       <string>(1~100)%</string>
-      </property>
-     </widget>
+     <property name="minimumSize">
+      <size>
+       <width>0</width>
+       <height>0</height>
+      </size>
+     </property>
+     <layout class="QGridLayout" name="gridLayout">
+      <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>
+      <property name="horizontalSpacing">
+       <number>7</number>
+      </property>
+      <property name="verticalSpacing">
+       <number>16</number>
+      </property>
+      <item row="4" column="3">
+       <widget class="QLabel" name="label_21">
+        <property name="text">
+         <string>(0.0~1.0)</string>
+        </property>
+       </widget>
+      </item>
+      <item row="6" column="0" colspan="2">
+       <widget class="QLabel" name="label_computeParam">
+        <property name="text">
+         <string>计算参数</string>
+        </property>
+       </widget>
+      </item>
+      <item row="4" column="5">
+       <widget class="QLineEdit" name="lineEdit_thresholdDB">
+        <property name="minimumSize">
+         <size>
+          <width>192</width>
+          <height>32</height>
+         </size>
+        </property>
+       </widget>
+      </item>
+      <item row="2" column="4">
+       <widget class="QLabel" name="label_5">
+        <property name="minimumSize">
+         <size>
+          <width>0</width>
+          <height>0</height>
+         </size>
+        </property>
+        <property name="maximumSize">
+         <size>
+          <width>16777215</width>
+          <height>16777215</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 row="1" column="1" colspan="2">
+       <widget class="QLineEdit" name="lineEdit_noiseOneDetectDuration">
+        <property name="minimumSize">
+         <size>
+          <width>192</width>
+          <height>32</height>
+         </size>
+        </property>
+       </widget>
+      </item>
+      <item row="4" column="4">
+       <widget class="QLabel" name="label_7">
+        <property name="minimumSize">
+         <size>
+          <width>0</width>
+          <height>0</height>
+         </size>
+        </property>
+        <property name="maximumSize">
+         <size>
+          <width>16777215</width>
+          <height>16777215</height>
+         </size>
+        </property>
+        <property name="text">
+         <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; color:#d21f21;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot; color:#000000;&quot;&gt;分贝阈值&lt;/span&gt;:&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+        </property>
+        <property name="alignment">
+         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+        </property>
+       </widget>
+      </item>
+      <item row="1" column="3">
+       <widget class="QLabel" name="label_27">
+        <property name="text">
+         <string>(1~100)</string>
+        </property>
+       </widget>
+      </item>
+      <item row="7" column="0">
+       <widget class="QLabel" name="label_10">
+        <property name="minimumSize">
+         <size>
+          <width>0</width>
+          <height>0</height>
+         </size>
+        </property>
+        <property name="maximumSize">
+         <size>
+          <width>16777215</width>
+          <height>16777215</height>
+         </size>
+        </property>
+        <property name="text">
+         <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; color:#d21f21;&quot;&gt;*&lt;/span&gt;每段样本数:&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+        </property>
+        <property name="alignment">
+         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+        </property>
+       </widget>
+      </item>
+      <item row="2" column="6">
+       <widget class="QLabel" name="label_23">
+        <property name="text">
+         <string>(1~100)%</string>
+        </property>
+       </widget>
+      </item>
+      <item row="1" column="0">
+       <widget class="QLabel" name="label_2">
+        <property name="minimumSize">
+         <size>
+          <width>0</width>
+          <height>0</height>
+         </size>
+        </property>
+        <property name="maximumSize">
+         <size>
+          <width>16777215</width>
+          <height>16777215</height>
+         </size>
+        </property>
+        <property name="text">
+         <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; color:#d21f21;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot; color:#000000;&quot;&gt;单次&lt;/span&gt;噪音检测时长(秒):&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+        </property>
+        <property name="alignment">
+         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+        </property>
+       </widget>
+      </item>
+      <item row="1" column="4">
+       <widget class="QLabel" name="label_4">
+        <property name="minimumSize">
+         <size>
+          <width>0</width>
+          <height>0</height>
+         </size>
+        </property>
+        <property name="maximumSize">
+         <size>
+          <width>16777215</width>
+          <height>16777215</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 row="4" column="0">
+       <widget class="QLabel" name="label_6">
+        <property name="minimumSize">
+         <size>
+          <width>0</width>
+          <height>0</height>
+         </size>
+        </property>
+        <property name="maximumSize">
+         <size>
+          <width>16777215</width>
+          <height>16777215</height>
+         </size>
+        </property>
+        <property name="text">
+         <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; color:#d21f21;&quot;&gt;*&lt;/span&gt;静音阈值:&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+        </property>
+        <property name="alignment">
+         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+        </property>
+       </widget>
+      </item>
+      <item row="5" column="1">
+       <widget class="QLineEdit" name="lineEdit_thresholdCV">
+        <property name="minimumSize">
+         <size>
+          <width>192</width>
+          <height>32</height>
+         </size>
+        </property>
+       </widget>
+      </item>
+      <item row="7" column="4">
+       <widget class="QLabel" name="label_11">
+        <property name="minimumSize">
+         <size>
+          <width>0</width>
+          <height>0</height>
+         </size>
+        </property>
+        <property name="maximumSize">
+         <size>
+          <width>16777215</width>
+          <height>16777215</height>
+         </size>
+        </property>
+        <property name="text">
+         <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; color:#d21f21;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot; color:#000000;&quot;&gt;重叠样本数&lt;/span&gt;:&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+        </property>
+        <property name="alignment">
+         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+        </property>
+       </widget>
+      </item>
+      <item row="0" column="0" colspan="2">
+       <widget class="QLabel" name="label_noiseParam">
+        <property name="text">
+         <string>噪音判断条件</string>
+        </property>
+       </widget>
+      </item>
+      <item row="5" column="0">
+       <widget class="QLabel" name="label_28">
+        <property name="minimumSize">
+         <size>
+          <width>0</width>
+          <height>0</height>
+         </size>
+        </property>
+        <property name="maximumSize">
+         <size>
+          <width>16777215</width>
+          <height>16777215</height>
+         </size>
+        </property>
+        <property name="text">
+         <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; color:#d21f21;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot; color:#000000;&quot;&gt;变异系数阈值&lt;/span&gt;:&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+        </property>
+        <property name="alignment">
+         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+        </property>
+       </widget>
+      </item>
+      <item row="4" column="1" colspan="2">
+       <widget class="QLineEdit" name="lineEdit_thresholdSlient">
+        <property name="minimumSize">
+         <size>
+          <width>192</width>
+          <height>32</height>
+         </size>
+        </property>
+       </widget>
+      </item>
+      <item row="2" column="1" colspan="2">
+       <widget class="QLineEdit" name="lineEdit_noiseContinueCountIsWarn">
+        <property name="minimumSize">
+         <size>
+          <width>192</width>
+          <height>32</height>
+         </size>
+        </property>
+       </widget>
+      </item>
+      <item row="3" column="0" colspan="2">
+       <widget class="QLabel" name="label_threshold">
+        <property name="text">
+         <string>阈值</string>
+        </property>
+       </widget>
+      </item>
+      <item row="7" column="5">
+       <widget class="QLineEdit" name="lineEdit_noverlap">
+        <property name="minimumSize">
+         <size>
+          <width>192</width>
+          <height>32</height>
+         </size>
+        </property>
+       </widget>
+      </item>
+      <item row="1" column="6">
+       <widget class="QLabel" name="label_20">
+        <property name="text">
+         <string>(1~100)</string>
+        </property>
+       </widget>
+      </item>
+      <item row="8" column="0">
+       <widget class="QLabel" name="label_13">
+        <property name="minimumSize">
+         <size>
+          <width>0</width>
+          <height>0</height>
+         </size>
+        </property>
+        <property name="maximumSize">
+         <size>
+          <width>16777215</width>
+          <height>16777215</height>
+         </size>
+        </property>
+        <property name="text">
+         <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; color:#d21f21;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot; color:#000000;&quot;&gt;FFT点数&lt;/span&gt;:&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+        </property>
+        <property name="alignment">
+         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+        </property>
+       </widget>
+      </item>
+      <item row="8" column="1" colspan="2">
+       <widget class="QLineEdit" name="lineEdit_nfft">
+        <property name="minimumSize">
+         <size>
+          <width>192</width>
+          <height>32</height>
+         </size>
+        </property>
+       </widget>
+      </item>
+      <item row="7" column="1" colspan="2">
+       <widget class="QLineEdit" name="lineEdit_nperseg">
+        <property name="minimumSize">
+         <size>
+          <width>192</width>
+          <height>32</height>
+         </size>
+        </property>
+       </widget>
+      </item>
+      <item row="2" column="5">
+       <widget class="QLineEdit" name="lineEdit_noiseContinueCountPercent">
+        <property name="minimumSize">
+         <size>
+          <width>192</width>
+          <height>32</height>
+         </size>
+        </property>
+       </widget>
+      </item>
+      <item row="1" column="5">
+       <widget class="QLineEdit" name="lineEdit_noiseDetectContinueCount">
+        <property name="minimumSize">
+         <size>
+          <width>192</width>
+          <height>32</height>
+         </size>
+        </property>
+       </widget>
+      </item>
+      <item row="5" column="3">
+       <widget class="QLabel" name="label_22">
+        <property name="text">
+         <string>(-100~0)</string>
+        </property>
+       </widget>
+      </item>
+      <item row="2" column="0">
+       <widget class="QLabel" name="label_3">
+        <property name="minimumSize">
+         <size>
+          <width>0</width>
+          <height>0</height>
+         </size>
+        </property>
+        <property name="maximumSize">
+         <size>
+          <width>16777215</width>
+          <height>16777215</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 row="4" column="6">
+       <widget class="QLabel" name="label_25">
+        <property name="text">
+         <string>(-100~0)</string>
+        </property>
+       </widget>
+      </item>
+     </layout>
     </widget>
    </item>
+   <item>
+    <spacer name="verticalSpacer">
+     <property name="orientation">
+      <enum>Qt::Vertical</enum>
+     </property>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>20</width>
+       <height>40</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
   </layout>
  </widget>
  <resources/>

+ 31 - 8
SettingLibrary/Modules/Noise/noisewidget.cpp

@@ -23,23 +23,29 @@ NoiseWidget::NoiseWidget(QWidget *parent) :
         return;
     }
 
+    /* 隐藏不需要的输入栏 */
+    /* 噪音服务地址 */
+    ui->lineEdit_serverAddr->hide();
+    ui->label_5->hide();
+    /* 噪音文件目录 */
+    ui->lineEdit_noiseFileDir->hide();
+    ui->label_2->hide();
+    /* 服务程序路径 */
+    ui->lineEdit_serverPath->hide();
+    ui->label_3->hide();
+
     /* 设置输入数字的栏只能输入数字 */
     ui->lineEdit_detectInternal->setValidator(new QIntValidator(this));
 
     /* 设置初始参数 */
-    const NoiseDetectBaseConfig_t &noiseConfig = SysConfig.getNoiseDetectBaseConfig();
-    ui->lineEdit_serverAddr->setText(noiseConfig.strNoiseServerAddr);
-    ui->lineEdit_noiseFileDir->setText(noiseConfig.strNoiseDetectDir);
-    ui->lineEdit_serverPath->setText(noiseConfig.strServerPath);
-    ui->lineEdit_serverPath->setText(noiseConfig.strServerPath);
-    ui->lineEdit_detectInternal->setText(QString::number(noiseConfig.nNoiseDetectDuration));
-    ui->checkBox_enableNoiseDetect->setChecked(noiseConfig.isEnableNoiseDetect);
-    ui->checkBox_mainRoadEnable->setChecked(noiseConfig.isEnableMainRoadDetect);
+    do_pBtn_restore_clicked();
 
     /* 获取噪音检测参数 */
     m_noiseDetectParam = SysConfig.getNoiseDetectParam();
 
+    /* 连接信号和槽 */
     connect(ui->pBtn_editNoiseParam, &QPushButton::clicked, this, &NoiseWidget::do_pBtn_editNoiseParam_clicked);
+    connect(ui->pBtn_restore, &QPushButton::clicked, this, &NoiseWidget::do_pBtn_restore_clicked);
 
     UIStyle.registerWidget(this);
 }
@@ -68,6 +74,19 @@ void NoiseWidget::do_pBtn_editNoiseParam_clicked()
 
 }
 
+/* 恢复配置项 */
+void NoiseWidget::do_pBtn_restore_clicked()
+{
+    const NoiseDetectBaseConfig_t &noiseConfig = SysConfig.getNoiseDetectBaseConfig();
+    ui->lineEdit_serverAddr->setText(noiseConfig.strNoiseServerAddr);
+    ui->lineEdit_noiseFileDir->setText(noiseConfig.strNoiseDetectDir);
+    ui->lineEdit_serverPath->setText(noiseConfig.strServerPath);
+    ui->lineEdit_serverPath->setText(noiseConfig.strServerPath);
+    ui->lineEdit_detectInternal->setText(QString::number(noiseConfig.nNoiseDetectDuration));
+    ui->checkBox_enableNoiseDetect->setChecked(noiseConfig.isEnableNoiseDetect);
+    ui->checkBox_mainRoadEnable->setChecked(noiseConfig.isEnableMainRoadDetect);
+}
+
 
 /* 保存参数 */
 bool NoiseWidget::saveConfig()
@@ -121,6 +140,7 @@ bool NoiseWidget::saveBaseConfig()
         SPDLOG_LOGGER_ERROR(m_logger, "更新噪音检测基础配置失败");
         return false;
     }
+    SPDLOG_LOGGER_DEBUG(m_logger, "噪音检测基础配置更新成功");
 
     return true;
 }
@@ -153,6 +173,9 @@ bool NoiseWidget::saveNoiseDetectParam()
 
     /* 更新系统配置 */
     SysConfig.setNoiseDetectParam(m_noiseDetectParam);
+    SPDLOG_LOGGER_DEBUG(m_logger, "噪音检测参数更新成功");
 
     return true;
 }
+
+

+ 3 - 0
SettingLibrary/Modules/Noise/noisewidget.h

@@ -27,7 +27,10 @@ public:
     bool saveConfig();
 
 private slots:
+    /* 修改噪音参数 */
     void do_pBtn_editNoiseParam_clicked();
+    /* 恢复配置项 */
+    void do_pBtn_restore_clicked();
 
 private:
     /* 保存基础参数 */

+ 20 - 13
SettingLibrary/Modules/Noise/noisewidget.ui

@@ -219,19 +219,6 @@
      </layout>
     </widget>
    </item>
-   <item>
-    <spacer name="verticalSpacer">
-     <property name="orientation">
-      <enum>Qt::Vertical</enum>
-     </property>
-     <property name="sizeHint" stdset="0">
-      <size>
-       <width>20</width>
-       <height>40</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
    <item>
     <layout class="QHBoxLayout" name="horizontalLayout_7">
      <item>
@@ -287,6 +274,26 @@
      </item>
     </layout>
    </item>
+   <item>
+    <widget class="QLabel" name="label_tip">
+     <property name="text">
+      <string>可恢复为编辑时的初始字段信息</string>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <spacer name="verticalSpacer">
+     <property name="orientation">
+      <enum>Qt::Vertical</enum>
+     </property>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>20</width>
+       <height>40</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
   </layout>
  </widget>
  <resources/>

+ 9 - 0
SettingLibrary/Resources/qss/white/aicomparewidget.qss

@@ -13,6 +13,15 @@ QLabel
 	color: #3A3F63;
 }
 
+QLabel#label_tip
+{
+	font-weight: 400;
+	font-size: 14px;
+	color: rgba(58,63,99,0.8);
+	line-height: 21px;
+	text-align: left;
+	font-style: normal;
+}
 
 /* ==========================================================
  *  QLineEdit

+ 1 - 1
SettingLibrary/Resources/qss/white/basicwidget.qss

@@ -11,7 +11,7 @@ QLabel
 	color: #3A3F63;
 }
 
-QLabel#labeltip
+QLabel#label_tip
 {
 	font-weight: 400;
 	font-size: 14px;

+ 16 - 1
SettingLibrary/Resources/qss/white/checkperiodwidget.qss

@@ -5,10 +5,14 @@ QWidget#widget_top, #widget_detectPlan, #widget_noDetectPlan
 }
 
 
-QWidget#widget_detectPlan,#widget_noDetectPlan
+QWidget#widget_detectPlan, #widget_noDetectPlan
 {
 	border-bottom: 1px solid #E9E9E9;
 }
+QWidget#widget_bottom
+{
+    border-top: none;
+}
 
 /* ==========================================================
  *  QLabel
@@ -37,6 +41,17 @@ QLabel#label_detectPlan, #label_noDetectPlan
 	font-size: 16px;
 }
 
+QLabel#label_tip
+{
+	font-weight: 400;
+	font-size: 14px;
+	color: rgba(58,63,99,0.8);
+	line-height: 21px;
+	text-align: left;
+	font-style: normal;
+}
+
+
 
 
 

+ 1 - 1
SettingLibrary/Resources/qss/white/compareitemlistwidget.qss

@@ -156,7 +156,7 @@ QTableView::item
 QTableView::item:selected
 {
     color: #FFFFFF;
-    background: #4458FE;
+    background: #bdbbf5;
     border-radius: 0px 0px 0px 0px;
     outline: none;
 }

+ 15 - 0
SettingLibrary/Resources/qss/white/databasewidget.qss

@@ -1,3 +1,17 @@
+
+
+QLabel#label_tip
+{
+	font-weight: 400;
+	font-size: 14px;
+	color: rgba(58,63,99,0.8);
+	line-height: 21px;
+	text-align: left;
+	font-style: normal;
+}
+
+
+
 /* ==========================================================
  *  QLineEdit
  * ========================================================== */
@@ -19,6 +33,7 @@ QLineEdit:hover,QLineEdit:focus
 }
 
 
+
 /* ==========================================================
  *  QPushButton
  * ========================================================== */

+ 17 - 0
SettingLibrary/Resources/qss/white/noisemonitorparamwidget.qss

@@ -1,3 +1,20 @@
+
+/* ==========================================================
+ *  QLabel
+ * ========================================================== */
+
+QLabel#label_noiseParam, #label_threshold, #label_computeParam
+{
+    font-weight: 500;
+    font-size: 16px;
+    color: #3A3F63;
+    line-height: 24px;
+    text-align: left;
+    font-style: normal;
+}
+
+
+
 /* ==========================================================
  *  QLineEdit
  * ========================================================== */

+ 11 - 0
SettingLibrary/Resources/qss/white/noisewidget.qss

@@ -10,6 +10,17 @@ QLabel
 	color: #3A3F63;
 }
 
+QLabel#label_tip
+{
+	font-weight: 400;
+	font-size: 14px;
+	color: rgba(58,63,99,0.8);
+	line-height: 21px;
+	text-align: left;
+	font-style: normal;
+}
+
+
 QLineEdit
 {
 	background: #FFFFFF;

+ 1 - 0
SettingLibrary/Resources/qss/white/setinfowidget.qss

@@ -7,6 +7,7 @@
 QWidget#widget_bottom
 {
 	background: #FFFFFF;
+	border-top: 1px solid #E9E9E9;
 }
 
 

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

@@ -6,6 +6,8 @@ QLabel
 }
 
 
+
+
 /* ==========================================================
  *  QLineEdit
  * ========================================================== */

+ 13 - 0
SettingLibrary/setinfomanager.cpp

@@ -108,6 +108,19 @@ int SetInfoManager::ShowWindow(int nSkinType, int nServiceID, bool bShowWindow)
     return 0;
 }
 
+/* 保存 */
+int SetInfoManager::Save()
+{
+    if(m_pWgtSet)
+    {
+        if(!m_pWgtSet->saveData())
+        {
+            return -1;
+        }
+    }
+    return 0;
+}
+
 /* 释放内存 */
 int SetInfoManager::Release()
 {

+ 3 - 0
SettingLibrary/setinfomanager.h

@@ -29,6 +29,9 @@ public:
     int CreateWindow(int nSkinType, QWidget* parent);
     int ShowWindow(int nSkinType, int nServiceID, bool bShowWindow);
 
+    /* 保存 */
+    int Save();
+
     /* 释放内存 */
     int Release();
 

+ 54 - 61
SettingLibrary/setinfowidget.cpp

@@ -1,8 +1,9 @@
 #include "setinfowidget.h"
-#include "CompareItemData.h"
-#include "ui_setinfowidget.h"
 
+#include <QTabBar>
 
+#include "CompareItemData.h"
+#include "ui_setinfowidget.h"
 #include "UIStyleManager.h"
 #include "tipwidget.h"
 #include "GlobalInfo.h"
@@ -19,6 +20,7 @@ SetInfoWidget::SetInfoWidget(QWidget *parent) :
     connect(ui->pBtn_cancel, &QPushButton::clicked, this, &SetInfoWidget::do_pBtn_cancel_clicked);
     connect(ui->tabWidget, &QTabWidget::currentChanged, this, &SetInfoWidget::do_tabWidget_currentChanged);
 
+
     /* 设置样式表 */
     UIStyle.registerWidget(this);
 }
@@ -68,6 +70,7 @@ void SetInfoWidget::setWebAPI(FromWebAPI* api)
 }
 
 
+
 /* 保存按钮 */
 void SetInfoWidget::do_pBtn_save_clicked()
 {
@@ -80,6 +83,7 @@ void SetInfoWidget::do_pBtn_cancel_clicked()
 
 }
 
+
 /* 切换了页面 */
 void SetInfoWidget::do_tabWidget_currentChanged(int index)
 {
@@ -117,70 +121,57 @@ void SetInfoWidget::do_tabWidget_currentChanged(int index)
     }
 }
 
-/* 保存数据 */
-void SetInfoWidget::saveData()
+/* 保存数据,这个是保存所有的数据 */
+bool SetInfoWidget::saveData()
 {
-    /* 获取当前页的编号 */
-    int currentIndex = ui->tabWidget->currentIndex();
-    QWidget* currentWidget = ui->tabWidget->currentWidget();
+
+
+    bool isSuccess = true;
+
     
-    bool isSuccess = false;
-    switch(currentIndex)
+    /* 保存基础信息 */
+    if(!ui->tabBasic->saveBasicInfo())
     {
-        case 0:     /* 基础信息 */
-            {
-                BasicWidget* widget = qobject_cast<BasicWidget*>(currentWidget);
-                if(widget)
-                {
-                    /* 保存基础信息 */
-                    isSuccess = widget->saveBasicInfo();
-                }
-            }
-            break;
-        case 1:     /* 对比项 */
-            {
-                AICompareWidget* widget = qobject_cast<AICompareWidget*>(currentWidget);
-                if(widget)
-                {
-                    /* 保存对比项信息 */
-                    isSuccess = widget->saveConfig();
-                }
-            }
-            break;
-        case 2:     /* 噪音检测 */
-            {
-                NoiseWidget* widget = qobject_cast<NoiseWidget*>(currentWidget);
-                if(widget)
-                {
-                    /* 保存噪音检测信息 */
-                    isSuccess = widget->saveConfig();
-                }
-            }
-            break;
-        case 3:     /* 数据库 */
-            {
-                DatabaseWidget* widget = qobject_cast<DatabaseWidget*>(currentWidget);
-                if(widget)
-                {
-                    /* 保存数据库信息 */
-                    isSuccess = widget->saveParams();
-                }
-            }
-            break;
-        case 4:     /* 检测时段 */
-            {
-                CheckPeriodWidget* widget = qobject_cast<CheckPeriodWidget*>(currentWidget);
-                if(widget)
-                {
-                    /* 保存检测时段信息 */
-                    isSuccess = widget->saveSettings();
-                }
-            }
-            break;
-        default:
-            break;
+        /* 保存失败 */
+        TipWidget::display(TipWidget::OPERATOR_FAIL, "基础信息保存失败", GInfo.getTopWindow());
+        isSuccess = false;
+    }
+    
+    /* 保存AI对比信息 */
+    if(!ui->tabAICompare->saveConfig())
+    {
+        /* 保存失败 */
+        TipWidget::display(TipWidget::OPERATOR_FAIL, "AI对比信息保存失败", GInfo.getTopWindow());
+        isSuccess = false;
+    }
+
+    /* 保存噪音检测信息 */
+    if(!ui->tabNoiseCheck->saveConfig())
+    {
+        /* 保存失败 */
+        TipWidget::display(TipWidget::OPERATOR_FAIL, "噪音检测信息保存失败", GInfo.getTopWindow());
+        isSuccess = false;
+    }
+
+    /* 保存数据库信息 */
+    if(!ui->tabDatabase->saveParams())
+    {
+        /* 保存失败 */
+        TipWidget::display(TipWidget::OPERATOR_FAIL, "数据库信息保存失败", GInfo.getTopWindow());
+        isSuccess = false;
     }
 
+    /* 保存检测时段信息 */
+    if(!ui->tabCheckPeriod->saveSettings())
+    {
+        /* 保存失败 */
+        TipWidget::display(TipWidget::OPERATOR_FAIL, "检测时段信息保存失败", GInfo.getTopWindow());
+        isSuccess = false;
+    }
+    
+
+
+
     if(isSuccess)
     {
         /* 保存成功 */
@@ -189,6 +180,8 @@ void SetInfoWidget::saveData()
         /* 保存失败 */
         TipWidget::display(TipWidget::OPERATOR_FAIL, "设置保存失败", GInfo.getTopWindow());
     }
+
+    return isSuccess;
 }
 
 

+ 4 - 2
SettingLibrary/setinfowidget.h

@@ -21,6 +21,8 @@ public:
 
     /* 设置WebAPI */
     void setWebAPI(FromWebAPI* api);
+    /* 保存数据,这个是保存所有的数据 */
+    bool saveData();
 
 private slots:
     /* 保存按钮 */
@@ -28,12 +30,12 @@ private slots:
     /* 取消按钮 */
     void do_pBtn_cancel_clicked();
 
+
     /* 切换了页面 */
     void do_tabWidget_currentChanged(int index);
 
 private:
-    /* 保存数据 */
-    void saveData();
+    
 
 
 

+ 12 - 6
SettingLibrary/setinfowidget.ui

@@ -16,7 +16,10 @@
   <property name="styleSheet">
    <string notr="true"/>
   </property>
-  <layout class="QGridLayout" name="gridLayout">
+  <layout class="QVBoxLayout" name="verticalLayout">
+   <property name="spacing">
+    <number>1</number>
+   </property>
    <property name="leftMargin">
     <number>0</number>
    </property>
@@ -29,10 +32,7 @@
    <property name="bottomMargin">
     <number>0</number>
    </property>
-   <property name="spacing">
-    <number>0</number>
-   </property>
-   <item row="0" column="0">
+   <item>
     <widget class="QTabWidget" name="tabWidget">
      <property name="currentIndex">
       <number>0</number>
@@ -64,7 +64,7 @@
      </widget>
     </widget>
    </item>
-   <item row="1" column="0">
+   <item>
     <widget class="QWidget" name="widget_bottom" native="true">
      <property name="minimumSize">
       <size>
@@ -72,6 +72,12 @@
        <height>64</height>
       </size>
      </property>
+     <property name="maximumSize">
+      <size>
+       <width>16777215</width>
+       <height>64</height>
+      </size>
+     </property>
      <layout class="QHBoxLayout" name="horizontalLayout">
       <property name="spacing">
        <number>16</number>

+ 14 - 20
common/DataManager/SystemConfig.cpp

@@ -193,19 +193,16 @@ bool SystemConfigInfo::getNoiseDetectParamFromJson(const std::string& jsonStr)
 {
     try {
         nJson jsonConfig = nJson::parse(jsonStr);
-        m_noiseDetectParam.strRegitrationCode = QString::fromStdString(jsonConfig["RegistrationCode"].get<std::string>());
+        m_noiseDetectParam.nNoiseOneDetectDuration = jsonConfig["NoiseOneDetectDuration"].is_null() ? 0 : jsonConfig["NoiseOneDetectDuration"].get<int>();
         m_noiseDetectParam.nNoiseDetectContinueCount = jsonConfig["NoiseDetectContinueCount"].is_null() ? 0 : jsonConfig["NoiseDetectContinueCount"].get<int>();
         m_noiseDetectParam.nNoiseContinueCountIsWarn = jsonConfig["NoiseContinueCountIsWarn"].is_null() ? 0 : jsonConfig["NoiseContinueCountIsWarn"].get<int>();
         m_noiseDetectParam.nNoiseContinueCountPercent = jsonConfig["NoiseContinueCountPercent"].is_null() ? 0 : jsonConfig["NoiseContinueCountPercent"].get<int>();
-        m_noiseDetectParam.nFreqComponentMini = jsonConfig["FreqComponentMini"].is_null() ? 0 : jsonConfig["FreqComponentMini"].get<int>();
-        m_noiseDetectParam.nFreqComponentMax = jsonConfig["FreqComponentMax"].is_null() ? 0 : jsonConfig["FreqComponentMax"].get<int>();   
-        m_noiseDetectParam.fOneDBThreshold = jsonConfig["OneDBThreshold"].is_null() ? 0.0f : jsonConfig["OneDBThreshold"].get<float>();
-        m_noiseDetectParam.nOneDBComponentMini = jsonConfig["OneDBComponentMini"].is_null() ? 0 : jsonConfig["OneDBComponentMini"].get<int>();
-        m_noiseDetectParam.fNoiseThreshold = jsonConfig["NoiseThreshold"].is_null() ? 0.0f : jsonConfig["NoiseThreshold"].get<float>();
-        m_noiseDetectParam.nNoiseComponentMini = jsonConfig["NoiseComponentMini"].is_null() ? 0 : jsonConfig["NoiseComponentMini"].get<int>();
-        m_noiseDetectParam.nNoiseDetectDuration = jsonConfig["NoiseDetectDuration"].is_null() ? 0 : jsonConfig["NoiseDetectDuration"].get<int>();
-        m_noiseDetectParam.nNoiseDetectPercent = jsonConfig["NoiseDetectPercent"].is_null() ? 0 : jsonConfig["NoiseDetectPercent"].get<int>();
-        m_noiseDetectParam.nNoiseDBMax = jsonConfig["NoiseDBMax"].is_null() ? 0 : jsonConfig["NoiseDBMax"].get<int>();
+        m_noiseDetectParam.dThresholdSlient = jsonConfig["ThresholdSlient"].is_null() ? 0.0 : jsonConfig["ThresholdSlient"].get<double>();
+        m_noiseDetectParam.dThresholdDB = jsonConfig["ThresholdDB"].is_null() ? 0.0 : jsonConfig["ThresholdDB"].get<double>();
+        m_noiseDetectParam.dThresholdCV = jsonConfig["ThresholdCV"].is_null() ? 0.0 : jsonConfig["ThresholdCV"].get<double>();
+        m_noiseDetectParam.nPerseg = jsonConfig["Perseg"].is_null() ? 0 : jsonConfig["Perseg"].get<int>();
+        m_noiseDetectParam.nOverlap = jsonConfig["Overlap"].is_null() ? 0 : jsonConfig["Overlap"].get<int>();
+        m_noiseDetectParam.nFFT = jsonConfig["FFT"].is_null() ? 0 : jsonConfig["FFT"].get<int>();
     }nJsonCatch
 
     return true;
@@ -216,19 +213,16 @@ bool SystemConfigInfo::setNoiseDetectParamToJson(const NoiseDetectParam_t& noise
 {
     try {
         nJson jsonConfig;
-        jsonConfig["RegistrationCode"] = noiseDetectParam.strRegitrationCode.toStdString();
+        jsonConfig["NoiseOneDetectDuration"] = noiseDetectParam.nNoiseOneDetectDuration;
         jsonConfig["NoiseDetectContinueCount"] = noiseDetectParam.nNoiseDetectContinueCount;
         jsonConfig["NoiseContinueCountIsWarn"] = noiseDetectParam.nNoiseContinueCountIsWarn;
         jsonConfig["NoiseContinueCountPercent"] = noiseDetectParam.nNoiseContinueCountPercent;
-        jsonConfig["FreqComponentMini"] = noiseDetectParam.nFreqComponentMini;
-        jsonConfig["FreqComponentMax"] = noiseDetectParam.nFreqComponentMax;
-        jsonConfig["OneDBThreshold"] = noiseDetectParam.fOneDBThreshold;
-        jsonConfig["OneDBComponentMini"] = noiseDetectParam.nOneDBComponentMini;
-        jsonConfig["NoiseThreshold"] = noiseDetectParam.fNoiseThreshold;
-        jsonConfig["NoiseComponentMini"] = noiseDetectParam.nNoiseComponentMini;
-        jsonConfig["NoiseDetectDuration"] = noiseDetectParam.nNoiseDetectDuration;
-        jsonConfig["NoiseDetectPercent"] = noiseDetectParam.nNoiseDetectPercent;
-        jsonConfig["NoiseDBMax"] = noiseDetectParam.nNoiseDBMax;
+        jsonConfig["ThresholdSlient"] = noiseDetectParam.dThresholdSlient;
+        jsonConfig["ThresholdDB"] = noiseDetectParam.dThresholdDB;
+        jsonConfig["ThresholdCV"] = noiseDetectParam.dThresholdCV;
+        jsonConfig["Perseg"] = noiseDetectParam.nPerseg;
+        jsonConfig["Overlap"] = noiseDetectParam.nOverlap;
+        jsonConfig["FFT"] = noiseDetectParam.nFFT;
 
         strJson = jsonConfig.dump();
     }nJsonCatch

+ 7 - 10
common/DataManager/SystemConfigStruct.cpp

@@ -75,19 +75,16 @@ bool NoiseDetectParam_t::operator==(const NoiseDetectParam_t &other) const
         return true; // 自身比较
     }
 
-    if( strRegitrationCode == other.strRegitrationCode &&
+    if( nNoiseOneDetectDuration == other.nNoiseOneDetectDuration &&
         nNoiseDetectContinueCount == other.nNoiseDetectContinueCount &&
         nNoiseContinueCountIsWarn == other.nNoiseContinueCountIsWarn &&
         nNoiseContinueCountPercent == other.nNoiseContinueCountPercent &&
-        nFreqComponentMini == other.nFreqComponentMini && 
-        nFreqComponentMax == other.nFreqComponentMax &&
-        fOneDBThreshold == other.fOneDBThreshold &&
-        nOneDBComponentMini == other.nOneDBComponentMini &&
-        fNoiseThreshold == other.fNoiseThreshold &&
-        nNoiseComponentMini == other.nNoiseComponentMini &&
-        nNoiseDetectDuration == other.nNoiseDetectDuration &&
-        nNoiseDetectPercent == other.nNoiseDetectPercent &&
-        nNoiseDBMax == other.nNoiseDBMax
+        dThresholdSlient == other.dThresholdSlient &&
+        dThresholdDB == other.dThresholdDB &&
+        dThresholdCV == other.dThresholdCV &&
+        nPerseg == other.nPerseg &&
+        nOverlap == other.nOverlap &&
+        nFFT == other.nFFT
     )
     {
         return true;

+ 9 - 10
common/DataManager/SystemConfigStruct.h

@@ -80,19 +80,18 @@ struct NoiseDetectBaseConfig_t
  */
 struct NoiseDetectParam_t
 {
-    QString strRegitrationCode;                 /* 注册码 */
+    int nNoiseOneDetectDuration = 0;            /* 单次噪音检测时长,单位为秒 */
     int nNoiseDetectContinueCount = 0;          /* 噪音检测持续次数 */
     int nNoiseContinueCountIsWarn = 0;          /* 噪音持续几次为报警 */
     int nNoiseContinueCountPercent = 0;         /* 检测持续次数中,噪音次数占的百分比 */
-    int nFreqComponentMini = 0;                 /* 噪音检测频率分量最小值 */
-    int nFreqComponentMax = 0;                  /* 噪音检测频率分量最大值 */
-    float fOneDBThreshold = 0;                  /* 单音量阈值 */
-    int nOneDBComponentMini = 0;                /* 单音量分量最小值 */
-    float fNoiseThreshold = 0;                  /* 噪音阈值 */
-    int nNoiseComponentMini = 0;                /* 噪音分量最小值 */
-    int nNoiseDetectDuration = 0;               /* 噪音判断时长单位ms */
-    int nNoiseDetectPercent = 0;                /* 噪音检测百分比 */
-    int nNoiseDBMax = 0;                        /* 噪音最大DB值 */
+    
+    double dThresholdSlient = 0;                /* 静音阈值 */
+    double dThresholdDB = 0;                    /* 分贝阈值 */
+    double dThresholdCV = 0;                    /* 变异系数阈值 */
+
+    int nPerseg = 0;                            /* 每段样本数 */
+    int nOverlap = 0;                           /* 重叠样本数 */
+    int nFFT= 0;                                /* FFT点数 */
 
     bool operator==(const NoiseDetectParam_t &other) const;
 };