noisemonitorparamdialog.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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 updateNoiseDetectParam();
  29. /* 设置限制参数范围 */
  30. void setLimitParamRange();
  31. /* 取消所有的报警红框 */
  32. void cancelAllWarn();
  33. private:
  34. Ui::NoiseMonitorParamWidget *ui;
  35. std::shared_ptr<spdlog::logger> m_logger = nullptr;
  36. NoiseDetectParam_t m_noiseDetectParam; // 噪音检测参数
  37. NoiseDetectParam_t m_defaultNoiseDetectParam;
  38. /* 检测参数范围 */
  39. int m_noiseOneDetectDurationLow = 1;
  40. int m_noiseOneDetectDurationHigh = 60;
  41. int m_noiseDetectContinueCountLow = 1;
  42. int m_noiseDetectContinueCountHigh = 100;
  43. int m_noiseContinueCountIsWarnLow = 1;
  44. int m_noiseContinueCountIsWarnHigh = 10;
  45. int m_noiseContinueCountPercentLow = 1;
  46. int m_noiseContinueCountPercentHigh = 100;
  47. double m_thresholdSlientLow = -99.99;
  48. double m_thresholdSlientHigh = 0;
  49. double m_thresholdDBLow = -100;
  50. double m_thresholdDBHigh = 0;
  51. double m_thresholdCVLow = -100;
  52. double m_thresholdCVHigh = 0;
  53. int m_npersegLow = 1;
  54. int m_npersegHigh = 4096;
  55. int m_noverlapLow = 0;
  56. int m_noverlapHigh = 4096;
  57. int m_nfftLow = 1;
  58. int m_nfftHigh = 4096;
  59. };
  60. #endif // NOISEMONITORPARAMDIALOG_H