SingleCameraOperationWnd.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. #pragma once
  2. #ifndef SINGLECAMERAOPERATIONWND_H
  3. #define SINGLECAMERAOPERATIONWND_H
  4. #include <QMainWindow>
  5. #include <QSlider>
  6. #include <QLineEdit>
  7. #include "CameraMaterialGroupWnd/MaterialWindow/Wafer.h"
  8. #include "CameraMaterialGroupWnd/MaterialWindow/Waffle.h"
  9. #include "CameraMaterialGroupWnd/MaterialWindow/MaterialBox.h"
  10. #include "CameraDataHandleAndShow.h"
  11. #include "CameraMaterialGroupWnd/CameraImage/CameraImageHandler.h"
  12. namespace Ui {
  13. class SingleCameraOperationWnd;
  14. }
  15. class SingleCameraOperationWnd : public QMainWindow
  16. {
  17. Q_OBJECT
  18. public:
  19. explicit SingleCameraOperationWnd(QWidget *parent = nullptr);
  20. ~SingleCameraOperationWnd();
  21. void initFrom();
  22. void connectSliderAndLineEdit(QSlider* slider, QLineEdit* lineEdit);
  23. void initSliders();
  24. void initLineEdits();
  25. void initProgressBar();
  26. // void saveSliderStates();
  27. // void loadSliderStates();
  28. void closeEvent(QCloseEvent *event) override;
  29. void loadGroupSettings(int Id, int Index);
  30. void clearLayout(); // 清除大窗口上当前的布局
  31. void WaferWidget(); // 圆晶
  32. void WaffleWidget(); // 华夫盒
  33. void MaterialBoxWidget(); // 料盒
  34. void startCamera(int cameraId);
  35. void updateImage(const QImage&image);
  36. public slots: // 确保这里声明了槽函数
  37. void onComboBoxIndexChanged(int index); // 确保签名匹配
  38. QString getImagePathFromIndex(int index);
  39. void handleDoubleClick();
  40. void showAndHideButton();
  41. void on_DatacomboBox_currentIndexChanged(int index);
  42. void handleComBoxChange(int groupId,int index);
  43. void loadLiveVedio();
  44. protected:
  45. void wheelEvent(QWheelEvent *event) override;
  46. void loadSettings();
  47. void checkSettings();
  48. void showEvent(QShowEvent *event) override;
  49. void hideEvent(QHideEvent *event) override;
  50. private slots:
  51. void on_ZoomUpButton_clicked();
  52. QPixmap getCurrentPixmap() const {
  53. return currentPixmap;
  54. }
  55. void on_ZoomOutButton_clicked();
  56. private:
  57. Ui::SingleCameraOperationWnd *ui;
  58. QPixmap currentPixmap;
  59. qreal scaleFactor;
  60. int lastGroupId = -1;
  61. int lastIndex = -1;
  62. Wafer *wafer; // 声明Wafer指针
  63. Waffle *waffle; // 声明Waffle指针
  64. MaterialBox *materialbox; // 声明materialbox指针
  65. bool isShow;
  66. ImageGrabber *m_grabber;
  67. QMap<int, Group*> groupMap;
  68. int currentCameraId;
  69. };
  70. #endif // SINGLECAMERAOPERATIONWND_H