123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122 |
- #ifndef SWITCHTABBASEWIDGET_H
- #define SWITCHTABBASEWIDGET_H
- #include <QWidget>
- #include <QWidget>
- #include <QSlider>
- #include <QLineEdit>
- #include <QIntValidator>
- #include <QProgressBar>
- #include <QLabel>
- #include "../CameraBind.h"
- #include "CameraMaterialGroupWnd/Group.h"
- struct ST_MOVE_AXIS
- {
- std::string ModuleType;
- std::string AxisType;
- double pos;
- };
- namespace Ui {
- class LightJoystickSwitchPage;
- }
- class LightJoystickSwitchPage : public QWidget
- {
- Q_OBJECT
- public:
- explicit LightJoystickSwitchPage(QWidget *parent = nullptr);
- ~LightJoystickSwitchPage();
- void setLigthValue(int redLight,int greenLight,int blueLight,int dotLight);
- void setLightWidget(int value, QWidget *lightWidget, QLineEdit *lineEdit, QSlider *slider, QProgressBar *progressBar, QLabel *label);
- public slots:
- void on_move_Button_clicked();
- void on_moveTo_Button_clicked();
- void on_up_Button_clicked();
- void on_left_Button_clicked();
- void on_right_Button_clicked();
- void on_down_Button_clicked();
- public:
-
- void InitMainCameraBind(CameraBind* pCameraBind, bool bUpdate = true);
- void UpdatemPageGroup(Group* pGroup);
-
- void SwitchJoystickPage(bool bSwitch);
-
- void HideOrShowPage(bool isHide);
-
- void SetMoveJoystickInfo(const ST_MOVE_AXIS& movInfo);
- protected:
- void timerEvent(QTimerEvent* event) override;
- private:
-
- QString CombiningStr(bool isUpdate = false);
-
- void RealTimeUpdatesToU();
-
- void ResetIdleTimer(bool bStart = false);
-
- void MoveJoystick();
-
- void UpdataLightVal();
-
- EN_LIGHT_INDEX MatchSelectedLightIndex(QLineEdit* lineEdit);
- void InitForm();
- void BondSliderAndLineEdit(QSlider* slider, QLineEdit* lineEdit);
- void SliderBind();
- void InitLineEdits();
- private:
- Ui::LightJoystickSwitchPage *ui;
-
- std::unique_ptr<CameraBind> m_pCameraBind;
-
-
- Group* m_pPageSwitchGroup = nullptr;
-
- ST_MOVE_AXIS m_moveAxisInfo;
-
- int m_idleTimer = -1;
- int m_nTimeShowPos = -1;
- };
- #endif
|