LightJoystickSwitchPage.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. #ifndef SWITCHTABBASEWIDGET_H
  2. #define SWITCHTABBASEWIDGET_H
  3. #include <QWidget>
  4. #include <QWidget>
  5. #include <QSlider>
  6. #include <QLineEdit>
  7. #include <QIntValidator>
  8. #include <QProgressBar>
  9. #include <QLabel>
  10. #include "../CameraBind.h"
  11. #include "CameraMaterialGroupWnd/Group.h"
  12. namespace Ui {
  13. class LightJoystickSwitchPage;
  14. }
  15. class LightJoystickSwitchPage : public QWidget
  16. {
  17. Q_OBJECT
  18. public:
  19. explicit LightJoystickSwitchPage(QWidget *parent = nullptr);
  20. ~LightJoystickSwitchPage();
  21. void setLigthValue(int redLight,int greenLight,int blueLight,int dotLight);
  22. void setLightWidget(int value, QWidget *lightWidget, QLineEdit *lineEdit, QSlider *slider, QProgressBar *progressBar, QLabel *label);
  23. void resizeSingleUI();
  24. public slots:
  25. void on_move_Button_clicked();
  26. void on_moveTo_Button_clicked();
  27. void on_up_Button_clicked();
  28. void on_left_Button_clicked();
  29. void on_right_Button_clicked();
  30. void on_down_Button_clicked();
  31. public slots:
  32. /**发送轴变化消息
  33. */
  34. void GetModuleTypeSlots(const ST_MOVE_AXIS& _module);
  35. public:
  36. /**拿到指针对界面操作
  37. */
  38. void InitMainCameraBind(CameraBind* pCameraBind, bool bUpdate = true);
  39. void UpdatemPageGroup(Group* pGroup);
  40. /**切换摇杆
  41. */
  42. void SwitchJoystickPage(bool bSwitch);
  43. /**显示或者隐藏当前页面
  44. */
  45. void HideOrShowPage(bool isHide);
  46. /**设置移动摇杆信息
  47. */
  48. void SetMoveJoystickInfo(const ST_MOVE_AXIS& movInfo);
  49. protected:
  50. void timerEvent(QTimerEvent* event) override;
  51. private:
  52. /**组合字符串
  53. */
  54. QString CombiningStr(bool isUpdate = false);
  55. /**实时更新
  56. */
  57. void RealTimeUpdatesToU();
  58. /**重置时间
  59. */
  60. void ResetIdleTimer(bool bStart = false);
  61. /**移动摇杆
  62. */
  63. void MoveJoystick();
  64. /**移动move ?
  65. */
  66. void RunMoveOrMoveTo(bool isMove);
  67. /**更新当前灯光值
  68. */
  69. void UpdataLightVal();
  70. /**匹配选中灯光索引
  71. */
  72. EN_LIGHT_INDEX MatchSelectedLightIndex(QLineEdit* lineEdit);
  73. void InitForm();
  74. void BondSliderAndLineEdit(QSlider* slider, QLineEdit* lineEdit);
  75. void SliderBind();
  76. void InitLineEdits();
  77. private:
  78. Ui::LightJoystickSwitchPage *ui;
  79. /**硬件指针
  80. */
  81. QPointer<CameraBind> m_pCameraBind;
  82. /**当前页面的Group
  83. */
  84. Group* m_pPageSwitchGroup = nullptr;
  85. /**移动轴信息
  86. */
  87. ST_MOVE_AXIS m_moveAxisInfo;
  88. /**用作定时使用,后面移动到整个类里面,目前先实现功能
  89. */
  90. int m_idleTimer = -1;
  91. int m_nTimeShowPos = -1;
  92. };
  93. #endif // SWITCHTABBASEWIDGET_H