123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156 |
- #ifndef VIEWWIDGETGROUP_H
- #define VIEWWIDGETGROUP_H
- #include <QWidget>
- #include <QVBoxLayout>
- #include <QstringList.h>
- #include "CameraMaterialGroupWnd/MaterialWindow/Wafer.h"
- #include "CameraMaterialGroupWnd/MaterialWindow/Waffle.h"
- #include "CameraMaterialGroupWnd/MaterialWindow/MaterialBox.h"
- #include "CameraMaterialGroupWnd/MaterialWindow/Bond.h"
- #include "OriginalWnd/CameraDataHandleAndShow.h"
- #include "CameraMaterialGroupWnd/CameraImage/CameraImageHandler.h"
- #include "ImageWidget.h"
- #include "../common/GlobalUse/JMouseMonitorThread.h"
- #include "../CameraBind.h"
- #include "ImageView.h"
- namespace Ui {
- class ControlOperationPage;
- }
- class ControlOperationPage : public QWidget
- {
- Q_OBJECT
- public:
- enum kinds{
- wafer_kind,
- waffle_kind,
- materialbox_kind,
- bond_kind
- };
- explicit ControlOperationPage(QWidget *parent = nullptr);
- ~ControlOperationPage();
- public:
- void initForm();
- void updateOperateWidget(const QPixmap& pixmap);
- void setDataSources(const QStringList& textList);
- void clearLayout();
- void updateScale(double newScaleFactor);
- void applyScale();
- void updateMaterialWidget( kinds materialWndType);
- void KindsofWidget(kinds kind);
- void setWafer(Wafer *wafer);
- void setWaffle(Waffle *waffle);
- void setMaterialBox(MaterialBox *materialbox);
- void setBond(Bond *bond);
- ImageWidget* getOperatewidget();
- void resizeSingleUI(bool bMax = false);
- void resizeChartsAndCamerasUI();
- qreal getScaleFactorValue();
- void setScaleFactorSize(QPixmap scaledImage);
- /**更新硬件指针
- */
- void UpDateCameraBind(CameraBind* pCameraBind);
- void setSwitchJoystickButEnable(bool isEnable);
- void setEnableControls(bool enable);
- void setBlueBord();
- void initImage();
- private slots:
- void on_ZoomUpButton_clicked();
- void on_ZoomOutButton_clicked();
- void on_RulerButton_clicked();
- void on_PenButton_clicked();
- //void on_PenButton_clicked();
- void handleDoubleClick();
- void on_switchJoystickBut_clicked();
-
- void on_moduleTypeComboBox_currentIndexChanged(int index);
- void on_axisTypeComboBox_currentIndexChanged(int index);
- void SaveNewImage();
- signals:
- /**发送轴变化消息
- */
- void SendModuleTypeSignals(const ST_MOVE_AXIS& _module);
- private slots:
- /**位置更新
- */
- void MouseMovedSlots(const QPoint& delta);
- void RequestCursorMoveSlots(const QPoint& pos);
-
- protected:
- void timerEvent(QTimerEvent* event) override;
- /*void mousePressEvent(QMouseEvent* event) override;
- void mouseMoveEvent(QMouseEvent* event) override;*/
- void wheelEvent(QWheelEvent* event) override;
- /*bool eventFilter(QObject* obj, QEvent* event) override;*/
- private:
- void HideLayout(bool bShow);
- void ResetIdleTimer(bool bStart = false);
- void InitWnd();
- /**创建鼠标控制线程,
- * @in isStart== false 关闭
- */
- void CreateMouseMonitor(bool isStart);
- /**鼠标操作
- */
- void LockMouse(bool islockMouse);
- /**更新轴状态
- */
- void UpdataModuleType(const QString& strMode,int nIndex);
- private:
- template<class T>
- void DeduplicationBox(QComboBox* pCom, const T& veTemp, int nIndex);
- private:
- Ui::ControlOperationPage* ui;
- QPixmap m_currentPixmap;
- qreal m_scaleFactor;
- QPoint m_mousePos;
- OperateMode m_currentMode = ModeImage;
- QGraphicsView* m_currentView = nullptr;
- double m_previousScaleFactor;
- Wafer* m_wafer = nullptr; // 声明Wafer指针
- Waffle* m_waffle = nullptr; // 声明Waffle指针
- MaterialBox* m_materialbox = nullptr; // 声明materialbox指针
- Bond* m_bond = nullptr;
- ImageView* m_currentImageView = nullptr;
- bool m_isEnable;
- QPoint m_pressPos; // 记录鼠标按下位置
- /**用作定时使用,后面移动到整个类里面,目前先实现功能
- */
- int m_idleTimer = -1;
- private:
- JMouseMonitorThread* m_pMousethread = nullptr;
- bool m_bMouseRun = false; // 重复点击
- bool m_isUserOnclick = false;
- /**硬件指针
- */
- QPointer<CameraBind> m_pCameraBindCopy;
- /**当前选中轴
- */
- ST_MOVE_AXIS m_currentSelectRunAxis = {};
- bool m_isAdd = false;
- };
- #endif // VIEWWIDGETGROUP_H
|