compareitemdialog.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. #ifndef COMPAREITEMDIALOG_H
  2. #define COMPAREITEMDIALOG_H
  3. #include "DialogBase.h"
  4. #include "singlecompareroadwidget.h"
  5. #include "GlobalVariable.h"
  6. #include <QDialog>
  7. #include <QVBoxLayout>
  8. namespace Ui {
  9. class CompareItemWidget;
  10. }
  11. enum class EDBType
  12. {
  13. DBType_Mute,
  14. DBType_Overload,
  15. DBType_Phase
  16. };
  17. /**
  18. * @brief 对比项设置页面
  19. *
  20. */
  21. class CompareItemDialog : public DialogBase
  22. {
  23. Q_OBJECT
  24. public:
  25. explicit CompareItemDialog(QWidget *parent = nullptr);
  26. ~CompareItemDialog();
  27. /* 设置可选的声卡通道信息 */
  28. void setSoundCardRoadList(const SoundCardInfo_t& soundCardInfo);
  29. /* 设置默认的参数 */
  30. void setDefaultParams(const CompareItemInfo_t& item);
  31. /* 获取生成的对比项信息 */
  32. CompareItemInfo_t& getCompareItemInfo();
  33. /* 设置样式表 */
  34. void setQSS();
  35. private slots:
  36. /* 新增通道 */
  37. void do_pBtn_add_clicked();
  38. /* 删除通道 */
  39. void do_CompareRoadWgtDeleted(int nIndex);
  40. /* 静音、过载、反相检测条件开关 */
  41. void do_checkBox_MOP_clicked(bool checked);
  42. private:
  43. /* 设置静音过载反相可编辑 */
  44. void setMOPEditable(EDBType type, bool editable);
  45. /* 设置检测参数输入栏只能输入数字 */
  46. void setDetectParamInputOnlyNumber();
  47. /* 新增一个通道 */
  48. SingleCompareRoadWidget* addOneRoadWidget(int nIndex, bool bDelBtnVisible = true);
  49. /* 重载按下关闭按钮之后,弹窗关闭之前的操作,在这里更新成员变量对比项信息 */
  50. bool isOKClicked() override;
  51. /* 获取对比项的基础信息 */
  52. bool getCompareItemBaseInfo(CompareItemInfo_t& compareItemInfo);
  53. /* 获取各个通道信息 */
  54. bool getCompareRoadInfo(CompareItemInfo_t& compareItemInfo);
  55. /* 获取音频检测信息 */
  56. bool getAudioDetectInfo(CompareItemInfo_t& compareItemInfo);
  57. /* 取消所有的报警 */
  58. void cancelAllWarn();
  59. private:
  60. Ui::CompareItemWidget *ui;
  61. SoundCardInfo_t m_soundCardInfo; /* 声卡信息 */
  62. QList<SingleCompareRoadWidget*> m_listOtherRoadWgt;
  63. CompareItemInfo_t m_compareItemInfo; /* 对比项信息 */
  64. QString m_qssRecordRoad; /* 录音通道的样式表 */
  65. };
  66. #endif // COMPAREITEMDIALOG_H