onesettingitem.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #ifndef ONESETTINGITEM_H
  2. #define ONESETTINGITEM_H
  3. #include <QWidget>
  4. #include "spdlog/spdlog.h"
  5. #include "EyeMapInfo.h"
  6. namespace Ui {
  7. class OneSettingItem;
  8. }
  9. class OneSettingItem : public QWidget
  10. {
  11. Q_OBJECT
  12. public:
  13. explicit OneSettingItem(QWidget *parent = nullptr);
  14. ~OneSettingItem();
  15. /* 设置序号 */
  16. void setNum(int num);
  17. /* 获取序号 */
  18. int getNum() { return eyeMapInfo.num; }
  19. /* 设置颜色 */
  20. void setColor(const QColor& color);
  21. /* 获取所有信息 */
  22. OneEyeMapInfo& getEyeMapInfo();
  23. /* 设置项信息 */
  24. void setItemInfo(const OneEyeMapInfo& info);
  25. /* 设置可选通道列表 */
  26. void setChannelList(const QList<OneChannelInfo>& list);
  27. /* 设置当前通道号 */
  28. void setCurrentChannel(const QString& channelName);
  29. void setCurrentChannel(const OscChnNum channel);
  30. /* 获取当前通道号 */
  31. OneChannelInfo getCurrentChannel();
  32. /* 设置自定义的通道名称栏报警 */
  33. void setChannelNameAlarm(bool isAlarm);
  34. /* 设置通道选择栏报警 */
  35. void setChannelSelectAlarm(bool isAlarm);
  36. signals:
  37. /* 选择了通道号信号 */
  38. void signal_select_channel(const OscChnNum channel, const QString& channelName);
  39. protected:
  40. /* 滚轮事件 */
  41. // void wheelEvent(QWheelEvent *event) override;
  42. /* 事件过滤器 */
  43. bool eventFilter(QObject *watched, QEvent *event) override;
  44. private slots:
  45. /* 设置颜色 */
  46. void do_pBtn_background();
  47. /* 选择了通道号 */
  48. void do_select_channel(int index);
  49. private:
  50. OneEyeMapInfo eyeMapInfo;
  51. private:
  52. Ui::OneSettingItem *ui;
  53. std::shared_ptr<spdlog::logger> m_logger = nullptr;
  54. };
  55. #endif // ONESETTINGITEM_H