noisemonitorparamdialog.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. #ifndef NOISEMONITORPARAMDIALOG_H
  2. #define NOISEMONITORPARAMDIALOG_H
  3. #include "DialogBase.h"
  4. #include "spdlog/spdlog.h"
  5. #include "SystemConfigStruct.h"
  6. namespace Ui {
  7. class NoiseMonitorParamWidget;
  8. }
  9. class NoiseMonitorParamDialog : public DialogBase
  10. {
  11. Q_OBJECT
  12. public:
  13. explicit NoiseMonitorParamDialog(QWidget *parent = nullptr);
  14. ~NoiseMonitorParamDialog();
  15. /* 设置初始参数 */
  16. void setInitialParams(NoiseDetectParam_t& noiseDetectParam);
  17. /* 获取当前参数 */
  18. NoiseDetectParam_t getCurrentParams() const { return m_noiseDetectParam; }
  19. private slots:
  20. /* 恢复默认值 */
  21. void do_pBtn_restoreDefault_clicked();
  22. private:
  23. /* 设置qss */
  24. void setQss();
  25. /* 点击了OK */
  26. bool isOKClicked() override;
  27. /* 判断是否有空的值 */
  28. bool isAnyValueEmpty();
  29. /* 更新噪音检测参数 */
  30. bool updateNoiseDetectParam();
  31. /* 设置限制参数范围 */
  32. void setLimitParamRange();
  33. /* 取消所有的报警红框 */
  34. void cancelAllWarn();
  35. private:
  36. Ui::NoiseMonitorParamWidget *ui;
  37. std::shared_ptr<spdlog::logger> m_logger = nullptr;
  38. NoiseDetectParam_t m_noiseDetectParam; // 噪音检测参数
  39. NoiseDetectParam_t m_defaultNoiseDetectParam;
  40. /* 检测参数范围 */
  41. int m_noiseOneDetectDurationLow = 1;
  42. int m_noiseOneDetectDurationHigh = 60;
  43. int m_noiseDetectContinueCountLow = 1;
  44. int m_noiseDetectContinueCountHigh = 100;
  45. int m_noiseContinueCountIsWarnLow = 1;
  46. int m_noiseContinueCountIsWarnHigh = 10;
  47. int m_noiseContinueCountPercentLow = 1;
  48. int m_noiseContinueCountPercentHigh = 100;
  49. double m_thresholdSlientLow = -99.99;
  50. double m_thresholdSlientHigh = 0;
  51. double m_thresholdDBLow = -100;
  52. double m_thresholdDBHigh = 0;
  53. double m_thresholdCVLow = -100;
  54. double m_thresholdCVHigh = 0;
  55. int m_npersegLow = 1;
  56. int m_npersegHigh = 4096;
  57. int m_noverlapLow = 0;
  58. int m_noverlapHigh = 4096;
  59. int m_nfftLow = 1;
  60. int m_nfftHigh = 4096;
  61. };
  62. #endif // NOISEMONITORPARAMDIALOG_H