LightJoystickSwitchPage.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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 slots:
  52. void on_xLineEdit_textChanged(const QString &arg1);
  53. void on_yLineEdit_textChanged(const QString &arg1);
  54. void on_zLineEdit_textChanged(const QString &arg1);
  55. void on_rLineEdit_textChanged(const QString &arg1);
  56. void on_forceLineEdit_textChanged(const QString &arg1);
  57. void on_modeComboBox_currentIndexChanged(int index);
  58. private:
  59. /**组合字符串
  60. */
  61. QString CombiningStr(bool isUpdate = false);
  62. /**实时更新
  63. */
  64. void RealTimeUpdatesToU();
  65. /**重置时间
  66. */
  67. void ResetIdleTimer(bool bStart = false);
  68. /**移动摇杆
  69. */
  70. void MoveJoystick();
  71. /**移动move ?
  72. */
  73. void RunMoveOrMoveTo(bool isMove);
  74. /**更新当前灯光值
  75. */
  76. void UpdataLightVal();
  77. /**匹配选中灯光索引
  78. */
  79. EN_LIGHT_INDEX MatchSelectedLightIndex(QLineEdit* lineEdit);
  80. void InitForm();
  81. void BondSliderAndLineEdit(QSlider* slider, QLineEdit* lineEdit);
  82. void SliderBind();
  83. void InitLineEdits();
  84. /**移动轴
  85. */
  86. void MoveModule(const QString strAxis, const QString pos);
  87. void DisableLayoutWidgets(QLayout* layout, bool isShow = false);
  88. template<class T>
  89. void DeduplicationBox(QComboBox* pCom, const T& veTemp, int nIndex);
  90. private:
  91. Ui::LightJoystickSwitchPage *ui;
  92. /**硬件指针
  93. */
  94. QPointer<CameraBind> m_pCameraBind; // 用这个是因为需要测试
  95. /**当前页面的Group
  96. */
  97. Group* m_pPageSwitchGroup = nullptr;
  98. /**移动轴信息
  99. */
  100. ST_MOVE_AXIS m_moveAxisInfo;
  101. /**用作定时使用,后面移动到整个类里面,目前先实现功能
  102. */
  103. int m_idleTimer = -1;
  104. int m_nTimeShowPos = -1;
  105. bool m_isSlots = false;
  106. };
  107. #endif // SWITCHTABBASEWIDGET_H