MainAndSecondaryCamerasWnd.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. #ifndef MAINANDSECONDARYCAMERASWND_H
  2. #define MAINANDSECONDARYCAMERASWND_H
  3. #include <QSlider>
  4. #include <QLineEdit>
  5. #include <QStack>
  6. #include <QHBoxLayout>
  7. #include "CameraMaterialGroupWnd/MaterialWindow/MaterialBox.h"
  8. #include "CameraMaterialGroupWnd/CameraImage/CameraImageHandler.h"
  9. #include <ICalibration.h>
  10. #include "JOriginalMainWnd.h"
  11. namespace Ui {
  12. class MainAndSecondaryCamerasWnd;
  13. }
  14. class MainAndSecondaryCamerasWnd : public JOriginalMainWnd
  15. {
  16. Q_OBJECT
  17. public:
  18. explicit MainAndSecondaryCamerasWnd(QWidget *parent = nullptr);
  19. ~MainAndSecondaryCamerasWnd();
  20. void initFrom();
  21. void InitPage();
  22. /**绑定相机画面
  23. */
  24. void CameraConnectUpdateImageFun(int nIndex, Group* widget);
  25. /**初始化界面运动控制轴
  26. */
  27. void updateMaterialWidget(int side, int materialWndType, int groupId);
  28. QStringList getImageslist();
  29. public slots:
  30. void CheckIs();
  31. protected:
  32. void wheelEvent(QWheelEvent* event) override;
  33. void loadSettings();
  34. void checkSettings();
  35. // void loadGroupSettings(int Id, int Index);
  36. /**更新刷新
  37. */
  38. void loadGroupSettings(int Id, int Index);
  39. void showEvent(QShowEvent *event) override;
  40. void hideEvent(QHideEvent *event) override;
  41. protected:
  42. void timerEvent(QTimerEvent* event) override;
  43. private slots:
  44. QPixmap getCurrentPixmap() const
  45. {
  46. return Right_currentPixmap;
  47. }
  48. void GetCurrentSelectSlots(int groupId, int nIndex);
  49. void GetUpDataImageShowSignals0(const QPixmap& imageData);
  50. void GetUpDataImageShowSignals1(const QPixmap& imageData);
  51. void GetUpDataImageShowSignals4(const QPixmap& imageData);
  52. private:
  53. void InitMainCameraBind(CameraBind* pCameraBind) override;
  54. void UpdateCameraDisplay0(int iCameraId, JVision::ImageInfo imageData) override;
  55. void UpdateCameraDisplay1(int iCameraId, JVision::ImageInfo imageData) override;
  56. void UpdateCameraDisplay2(int iCameraId, JVision::ImageInfo imageData) override;
  57. void UpdateCameraDisplay3(int iCameraId, JVision::ImageInfo imageData) override;
  58. void UpdateCameraDisplay4(int iCameraId, JVision::ImageInfo imageData) override;
  59. signals:
  60. void UpDataImageShowSignals0(const QPixmap& imageData);
  61. void UpDataImageShowSignals1(const QPixmap& imageData);
  62. void UpDataImageShowSignals2(const QPixmap& imageData);
  63. void UpDataImageShowSignals3(const QPixmap& imageData);
  64. void UpDataImageShowSignals4(const QPixmap& imageData);
  65. private:
  66. void HideLayout(QHBoxLayout* layout, bool isHide);
  67. /**更新灯光显示
  68. */
  69. void UpdataLightJoystickSwitchPage();
  70. private:
  71. Ui::MainAndSecondaryCamerasWnd *ui;
  72. QPixmap Left_currentPixmap;
  73. qreal Left_scaleFactor;
  74. QPixmap Right_currentPixmap;
  75. qreal Right_scaleFactor;
  76. int lastGroupId = -1;
  77. int lastIndex = -1;
  78. int lastLastGroupId = -1;
  79. int lastLastIndex = -1;
  80. QPixmap m_lastRightPixmap;
  81. QStringList lasttextList;
  82. QPixmap lastLastRightPixmap; // 用于存储上一次的 lastRightPixmap
  83. QStringList lastLasttextList;
  84. bool isUpdatingSettings;
  85. Wafer *wafer; // 声明Wafer指针
  86. Waffle *waffle; // 声明Waffle指针
  87. MaterialBox *materialbox; // 声明materialbox指针
  88. QMap<int, Wafer*> waferMap;
  89. /**当前选中的group
  90. */
  91. std::vector<ST_CURRENT_SELECT_GROUP> m_veCurrentSelectGroup;
  92. /**保存所有的后续使用
  93. */
  94. QStack<Group*> m_allGroup;
  95. int m_nIdex = 0;
  96. QMap<int, Waffle*> waffleMap;
  97. QMap<int, MaterialBox*> materialBoxMap;
  98. OperateMode Left_currentMode = ModeImage;
  99. OperateMode Right_currentMode = ModeImage;
  100. QGraphicsView *Left_currentView = nullptr;
  101. QGraphicsView *Right_currentView = nullptr;
  102. QPoint mousePos;
  103. double Left_previousScaleFactor;
  104. double Right_previousScaleFactor;
  105. const int last_left = 0;
  106. const int current_right = 1;
  107. };
  108. #endif // MAINANDSECONDARYCAMERASWND_H