#pragma once #ifndef SINGLECAMERAOPERATIONWND_H #define SINGLECAMERAOPERATIONWND_H #include #include #include #include "CameraMaterialGroupWnd/MaterialWindow/Wafer.h" #include "CameraMaterialGroupWnd/MaterialWindow/Waffle.h" #include "CameraMaterialGroupWnd/MaterialWindow/MaterialBox.h" #include "CameraDataHandleAndShow.h" #include "CameraMaterialGroupWnd/CameraImage/CameraImageHandler.h" #include "CameraMaterialGroupWnd/MaterialWindow/DraggableLine.h" #include "JOriginalMainWnd.h" namespace Ui { class SingleCameraOperationWnd; } class SingleCameraOperationWnd : public JOriginalMainWnd { Q_OBJECT public: explicit SingleCameraOperationWnd(QWidget *parent = nullptr); ~SingleCameraOperationWnd(); void initFrom(); void closeEvent(QCloseEvent *event) override; void loadGroupSettings(int Id, int Index); void startCamera(int cameraId); void stopCamera(int cameraId); void updateImage(const QImage&image); void updateMaterialWidget(int materialWndType, int groupId); public slots: // 确保这里声明了槽函数 // void onComboBoxIndexChanged(int index); // 确保签名匹配 QString getImagePathFromIndex(int index); void on_DatacomboBox_currentIndexChanged(int index); //void handleComBoxChange(int groupId,int index); void loadLiveVedio(); protected: void wheelEvent(QWheelEvent *event) override; void loadSettings(); void checkSettings(); void showEvent(QShowEvent *event) override; void hideEvent(QHideEvent *event) override; private slots: QPixmap getCurrentPixmap() const { return currentPixmap; } public: /**必须绑定它, 没必要一直new ,只是控制 */ virtual void InitMainCameraBind(CameraBind* pCameraBind); virtual void UpdateCameraDisplay0(int iCameraId, JVision::ImageInfo imageData); virtual void UpdateCameraDisplay1(int iCameraId, JVision::ImageInfo imageData); virtual void UpdateCameraDisplay2(int iCameraId, JVision::ImageInfo imageData); virtual void UpdateCameraDisplay3(int iCameraId, JVision::ImageInfo imageData); virtual void UpdateCameraDisplay4(int iCameraId, JVision::ImageInfo imageData); private : Ui::SingleCameraOperationWnd *ui; QPixmap currentPixmap; qreal scaleFactor; int lastGroupId = -1; int lastIndex = -1; Wafer *wafer; // 声明Wafer指针 Waffle *waffle; // 声明Waffle指针 MaterialBox *materialbox; // 声明materialbox指针 bool isShow; ImageGrabber *m_grabber; QMap groupMap; int currentCameraId; QMap waferMap; QMap waffleMap; QMap materialBoxMap; OperateMode currentMode = ModeImage; QGraphicsView *currentView = nullptr; QPoint mousePos; double previousScaleFactor; void updateScale(double newScaleFactor); // 更新缩放比例 void applyScale(); // 应用缩放 bool liveClick; }; #endif // SINGLECAMERAOPERATIONWND_H