#ifndef VIEWWIDGETGROUP_H #define VIEWWIDGETGROUP_H #include #include #include #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 setComboBox(const QList> fileList, const int index); void setEnableControls(bool enable); /**更新硬件指针 */ void UpDateCameraBind(CameraBind* pCameraBind); void setSwitchJoystickButEnable(bool isEnable); void setBlueBord(); void initImage(); QPixmap getCurrentComboBoxPixmap(const int index); 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(); void on_DataSources_currentIndexChanged(int comboxIndex); signals: /**发送轴变化消息 */ void SendModuleTypeSignals(const ST_MOVE_AXIS& _module); void send_ComboBox_singal(int index); 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 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; bool m_bRuler; QPoint m_pressPos; // 记录鼠标按下位置 /**用作定时使用,后面移动到整个类里面,目前先实现功能 */ int m_idleTimer = -1; private: JMouseMonitorThread* m_pMousethread = nullptr; bool m_bMouseRun = false; // 重复点击 bool m_isUserOnclick = false; /**硬件指针 */ QPointer m_pCameraBindCopy; /**当前选中轴 */ ST_MOVE_AXIS m_currentSelectRunAxis = {}; bool m_isAdd = false; }; #endif // VIEWWIDGETGROUP_H