MainAndSecondaryCamerasWnd.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. #ifndef MAINANDSECONDARYCAMERASWND_H
  2. #define MAINANDSECONDARYCAMERASWND_H
  3. #include <QSlider>
  4. #include <QLineEdit>
  5. #include <QHBoxLayout>
  6. #include "CameraMaterialGroupWnd/MaterialWindow/MaterialBox.h"
  7. #include "CameraMaterialGroupWnd/CameraImage/CameraImageHandler.h"
  8. #include <ICalibration.h>
  9. #include "JOriginalMainWnd.h"
  10. namespace Ui {
  11. class MainAndSecondaryCamerasWnd;
  12. }
  13. class MainAndSecondaryCamerasWnd : public JOriginalMainWnd
  14. {
  15. Q_OBJECT
  16. public:
  17. explicit MainAndSecondaryCamerasWnd(QWidget *parent = nullptr);
  18. ~MainAndSecondaryCamerasWnd();
  19. void initFrom();
  20. void InitPage();
  21. /**绑定相机画面
  22. */
  23. void CameraConnectUpdateImageFun(int nIndex, Group* widget);
  24. /**初始化界面运动控制轴
  25. */
  26. void updateMaterialWidget(int side, int materialWndType, int groupId);
  27. public slots:
  28. void CheckIs();
  29. protected:
  30. void wheelEvent(QWheelEvent* event) override;
  31. bool eventFilter(QObject* obj, QEvent* event) override;
  32. void loadSettings();
  33. void checkSettings();
  34. // void loadGroupSettings(int Id, int Index);
  35. /**更新刷新
  36. */
  37. void loadGroupSettings(int Id, int Index);
  38. void showEvent(QShowEvent *event) override;
  39. void hideEvent(QHideEvent *event) override;
  40. protected:
  41. void timerEvent(QTimerEvent* event) override;
  42. private slots:
  43. QPixmap getCurrentPixmap() const
  44. {
  45. return Right_currentPixmap;
  46. }
  47. void ResetIdleTimer(bool bStart = false);
  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(Group* pGroup);
  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. ST_CURRENT_SELECT_GROUP m_currentSelectGroup = {};
  93. int m_nIdex = 0;
  94. int m_nTimeShowPos = -1;
  95. /**用作定时使用,后面移动到整个类里面,目前先实现功能
  96. */
  97. int m_idleTimer = -1;
  98. QMap<int, Waffle*> waffleMap;
  99. QMap<int, MaterialBox*> materialBoxMap;
  100. OperateMode Left_currentMode = ModeImage;
  101. OperateMode Right_currentMode = ModeImage;
  102. QGraphicsView *Left_currentView = nullptr;
  103. QGraphicsView *Right_currentView = nullptr;
  104. QPoint mousePos;
  105. double Left_previousScaleFactor;
  106. double Right_previousScaleFactor;
  107. const int last_left = 0;
  108. const int current_right = 1;
  109. };
  110. #endif // MAINANDSECONDARYCAMERASWND_H