compareitemdialog.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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 setDefaultParams(const CompareItemInfo_t& item);
  29. /* 获取生成的对比项信息 */
  30. CompareItemInfo_t& getCompareItemInfo();
  31. private slots:
  32. /* 新增通道 */
  33. void do_pBtn_add_clicked();
  34. /* 删除通道 */
  35. void do_CompareRoadWgtDeleted(int nIndex);
  36. /* 静音、过载、反相检测条件开关 */
  37. void do_checkBox_MOP_clicked(bool checked);
  38. private:
  39. /* 设置样式表 */
  40. void setQSS();
  41. /* 设置静音过载反相可编辑 */
  42. void setMOPEditable(EDBType type, bool editable);
  43. /* 设置检测参数输入栏只能输入数字 */
  44. void setDetectParamInputOnlyNumber();
  45. /* 新增一个通道 */
  46. SingleCompareRoadWidget* addOneRoadWidget(int nIndex, bool bDelBtnVisible = true);
  47. /* 重载按下关闭按钮之后,弹窗关闭之前的操作,在这里更新成员变量对比项信息 */
  48. bool isOKClicked() override;
  49. /* 获取对比项的基础信息 */
  50. bool getCompareItemBaseInfo(CompareItemInfo_t& compareItemInfo);
  51. /* 获取各个通道信息 */
  52. bool getCompareRoadInfo(CompareItemInfo_t& compareItemInfo);
  53. /* 获取音频检测信息 */
  54. bool getAudioDetectInfo(CompareItemInfo_t& compareItemInfo);
  55. /* 取消所有的报警 */
  56. void cancelAllWarn();
  57. private:
  58. Ui::CompareItemWidget *ui;
  59. QList<SingleCompareRoadWidget*> m_listOtherRoadWgt;
  60. CompareItemInfo_t m_compareItemInfo; /* 对比项信息 */
  61. QString m_qssRecordRoad; /* 录音通道的样式表 */
  62. };
  63. #endif // COMPAREITEMDIALOG_H