MainAndSecondaryCamerasWnd.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. #ifndef MAINANDSECONDARYCAMERASWND_H
  2. #define MAINANDSECONDARYCAMERASWND_H
  3. #include <QMainWindow>
  4. #include <QSlider>
  5. #include <QLineEdit>
  6. #include "CameraMaterialGroupWnd/MaterialWindow/Wafer.h"
  7. #include "CameraMaterialGroupWnd/MaterialWindow/Waffle.h"
  8. #include "CameraMaterialGroupWnd/MaterialWindow/MaterialBox.h"
  9. namespace Ui {
  10. class MainAndSecondaryCamerasWnd;
  11. }
  12. class MainAndSecondaryCamerasWnd : public QMainWindow
  13. {
  14. Q_OBJECT
  15. public:
  16. explicit MainAndSecondaryCamerasWnd(QWidget *parent = nullptr);
  17. ~MainAndSecondaryCamerasWnd();
  18. void initFrom();
  19. void connectSliderAndLineEdit(QSlider* slider, QLineEdit* lineEdit);
  20. void initLineEdits();
  21. void initSliders();
  22. void initProgressBar();
  23. public slots: // 确保这里声明了槽函数
  24. void handleDoubleClick();
  25. void showAndHide();
  26. void showAndHide_L();
  27. void CheckIs();
  28. protected:
  29. void wheelEvent(QWheelEvent *event)override;
  30. void loadSettings();
  31. void checkSettings();
  32. void loadGroupSettings(int Id, int Index);
  33. void showEvent(QShowEvent *event) override;
  34. void hideEvent(QHideEvent *event) override;
  35. void clearLayout(int flag); // 清除大窗口上当前的布局
  36. void WaferWidget(int flag); // 圆晶
  37. void WaffleWidget(int flag); // 华夫盒
  38. void MaterialBoxWidget(int flag); // 料盒
  39. private slots:
  40. void on_LeftZoomUpButton_clicked();
  41. void on_RightZoomUpButton_clicked();
  42. void on_LeftZoomOutButton_clicked();
  43. void on_RightZoomOutButton_clicked();
  44. QPixmap getCurrentPixmap() const {
  45. return Right_currentPixmap;
  46. }
  47. private:
  48. Ui::MainAndSecondaryCamerasWnd *ui;
  49. QPixmap Left_currentPixmap;
  50. qreal Left_scaleFactor;
  51. QPixmap Right_currentPixmap;
  52. qreal Right_scaleFactor;
  53. int lastGroupId = -1;
  54. int lastIndex = -1;
  55. int lastLastGroupId = -1;
  56. int lastLastIndex = -1;
  57. QPixmap lastRightPixmap;
  58. QStringList lasttextList;
  59. QPixmap lastLastRightPixmap; // 用于存储上一次的 lastRightPixmap
  60. QStringList lastLasttextList;
  61. bool isUpdatingSettings;
  62. Wafer *wafer; // 声明Wafer指针
  63. Waffle *waffle; // 声明Waffle指针
  64. MaterialBox *materialbox; // 声明materialbox指针
  65. bool isShow;
  66. bool isShow_L;
  67. QMap<int, Wafer*> waferMap;
  68. OperateMode Left_currentMode = ModeImage;
  69. OperateMode Right_currentMode = ModeImage;
  70. QGraphicsView *Left_currentView = nullptr;
  71. QGraphicsView *Right_currentView = nullptr;
  72. QPoint mousePos;
  73. double Left_previousScaleFactor;
  74. double Right_previousScaleFactor;
  75. void updateScale(double newScaleFactor, int flag); // 更新缩放比例
  76. void applyScale(int flag); // 应用缩放
  77. };
  78. #endif // MAINANDSECONDARYCAMERASWND_H