onesettingitem.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. /* 获取当前通道号 */
  30. OneChannelInfo getCurrentChannel();
  31. /* 设置自定义的通道名称栏报警 */
  32. void setChannelNameAlarm(bool isAlarm);
  33. /* 设置通道选择栏报警 */
  34. void setChannelSelectAlarm(bool isAlarm);
  35. signals:
  36. /* 选择了通道号信号 */
  37. void signal_select_channel(const OscChnNum channel, const QString& channelName);
  38. protected:
  39. /* 滚轮事件 */
  40. // void wheelEvent(QWheelEvent *event) override;
  41. /* 事件过滤器 */
  42. bool eventFilter(QObject *watched, QEvent *event) override;
  43. private slots:
  44. /* 设置颜色 */
  45. void do_pBtn_background();
  46. /* 选择了通道号 */
  47. void do_select_channel(int index);
  48. private:
  49. OneEyeMapInfo eyeMapInfo;
  50. private:
  51. Ui::OneSettingItem *ui;
  52. std::shared_ptr<spdlog::logger> m_logger = nullptr;
  53. };
  54. #endif // ONESETTINGITEM_H