MainAndSecondaryCamerasWnd.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  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 UpdataGroupSettings(int Id, int Index);
  38. void showEvent(QShowEvent *event) override;
  39. void hideEvent(QHideEvent *event) override;
  40. void clearLayout(int flag); // 清除大窗口上当前的布局
  41. void WaferWidget(int flag); // 圆晶
  42. void WaffleWidget(int flag); // 华夫盒
  43. void MaterialBoxWidget(int flag); // 料盒
  44. protected:
  45. void timerEvent(QTimerEvent* event) override;
  46. private slots:
  47. QPixmap getCurrentPixmap() const
  48. {
  49. return Right_currentPixmap;
  50. }
  51. void ResetIdleTimer(bool bStart = false);
  52. void GetCurrentSelectSlots(int groupId, int nIndex);
  53. void GetUpDataImageShowSignals0(const QPixmap& imageData);
  54. void GetUpDataImageShowSignals1(const QPixmap& imageData);
  55. void GetUpDataImageShowSignals4(const QPixmap& imageData);
  56. private:
  57. void InitMainCameraBind(CameraBind* pCameraBind) override;
  58. void UpdateCameraDisplay0(int iCameraId, JVision::ImageInfo imageData) override;
  59. void UpdateCameraDisplay1(int iCameraId, JVision::ImageInfo imageData) override;
  60. void UpdateCameraDisplay2(int iCameraId, JVision::ImageInfo imageData) override;
  61. void UpdateCameraDisplay3(int iCameraId, JVision::ImageInfo imageData) override;
  62. void UpdateCameraDisplay4(int iCameraId, JVision::ImageInfo imageData) override;
  63. signals:
  64. void UpDataImageShowSignals0(const QPixmap& imageData);
  65. void UpDataImageShowSignals1(const QPixmap& imageData);
  66. void UpDataImageShowSignals2(const QPixmap& imageData);
  67. void UpDataImageShowSignals3(const QPixmap& imageData);
  68. void UpDataImageShowSignals4(const QPixmap& imageData);
  69. private:
  70. void HideLayout(QHBoxLayout* layout, bool isHide);
  71. /**更新灯光显示
  72. */
  73. void UpdataLightJoystickSwitchPage(Group* pGroup);
  74. private:
  75. Ui::MainAndSecondaryCamerasWnd *ui;
  76. QPixmap Left_currentPixmap;
  77. qreal Left_scaleFactor;
  78. QPixmap Right_currentPixmap;
  79. qreal Right_scaleFactor;
  80. int lastGroupId = -1;
  81. int lastIndex = -1;
  82. int lastLastGroupId = -1;
  83. int lastLastIndex = -1;
  84. QPixmap m_lastRightPixmap;
  85. QStringList lasttextList;
  86. QPixmap lastLastRightPixmap; // 用于存储上一次的 lastRightPixmap
  87. QStringList lastLasttextList;
  88. bool isUpdatingSettings;
  89. Wafer *wafer; // 声明Wafer指针
  90. Waffle *waffle; // 声明Waffle指针
  91. MaterialBox *materialbox; // 声明materialbox指针
  92. QMap<int, Wafer*> waferMap;
  93. /**当前选中的group
  94. */
  95. std::vector<ST_CURRENT_SELECT_GROUP> m_veCurrentSelectGroup = {};
  96. ST_CURRENT_SELECT_GROUP m_currentSelectGroup = {};
  97. int m_nIdex = 0;
  98. int m_nTimeShowPos = -1;
  99. /**用作定时使用,后面移动到整个类里面,目前先实现功能
  100. */
  101. int m_idleTimer = -1;
  102. QMap<int, Waffle*> waffleMap;
  103. QMap<int, MaterialBox*> materialBoxMap;
  104. OperateMode Left_currentMode = ModeImage;
  105. OperateMode Right_currentMode = ModeImage;
  106. QGraphicsView *Left_currentView = nullptr;
  107. QGraphicsView *Right_currentView = nullptr;
  108. QPoint mousePos;
  109. double Left_previousScaleFactor;
  110. double Right_previousScaleFactor;
  111. const int last_left = 0;
  112. const int current_right = 1;
  113. };
  114. #endif // MAINANDSECONDARYCAMERASWND_H