compareitemdialog.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. private slots:
  34. /* 新增通道 */
  35. void do_pBtn_add_clicked();
  36. /* 删除通道 */
  37. void do_CompareRoadWgtDeleted(int nIndex);
  38. /* 静音、过载、反相检测条件开关 */
  39. void do_checkBox_MOP_clicked(bool checked);
  40. private:
  41. /* 设置样式表 */
  42. void setQSS();
  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