ControlOperationPage.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. #ifndef VIEWWIDGETGROUP_H
  2. #define VIEWWIDGETGROUP_H
  3. #include <QWidget>
  4. #include <QVBoxLayout>
  5. #include <QstringList.h>
  6. #include "CameraMaterialGroupWnd/MaterialWindow/Wafer.h"
  7. #include "CameraMaterialGroupWnd/MaterialWindow/Waffle.h"
  8. #include "CameraMaterialGroupWnd/MaterialWindow/MaterialBox.h"
  9. #include "OriginalWnd/CameraDataHandleAndShow.h"
  10. #include "CameraMaterialGroupWnd/CameraImage/CameraImageHandler.h"
  11. #include "ImageWidget.h"
  12. #include "../common/GlobalUse/JMouseMonitorThread.h"
  13. #include "../CameraBind.h"
  14. namespace Ui {
  15. class ControlOperationPage;
  16. }
  17. class ControlOperationPage : public QWidget
  18. {
  19. Q_OBJECT
  20. public:
  21. enum kinds{
  22. wafer_kind,
  23. waffle_kind,
  24. materialbox_kind,
  25. bond_kind
  26. };
  27. explicit ControlOperationPage(QWidget *parent = nullptr);
  28. ~ControlOperationPage();
  29. public:
  30. void initForm();
  31. void updateOperateWidget(const QPixmap& pixmap);
  32. void setDataSources(const QStringList& textList);
  33. void clearLayout();
  34. void updateScale(double newScaleFactor);
  35. void applyScale();
  36. void updateMaterialWidget( kinds materialWndType);
  37. void KindsofWidget(kinds kind);
  38. void setWafer(Wafer *wafer);
  39. void setWaffle(Waffle *waffle);
  40. void setMaterialBox(MaterialBox *materialbox);
  41. //void setBond(Bond *bond);
  42. ImageWidget* getOperatewidget();
  43. void resizeSingleUI(bool bMax = false);
  44. void resizeChartsAndCamerasUI();
  45. /**更新硬件指针
  46. */
  47. void UpDateCameraBind(CameraBind* pCameraBind);
  48. void setEnableControls(bool enable);
  49. private slots:
  50. void on_ZoomUpButton_clicked();
  51. void on_ZoomOutButton_clicked();
  52. // void on_RulerButton_clicked();
  53. //void on_PenButton_clicked();
  54. void handleDoubleClick();
  55. void on_switchJoystickBut_clicked();
  56. private slots:
  57. /**位置更新
  58. */
  59. void MouseMovedSlots(const QPoint& delta);
  60. void RequestCursorMoveSlots(const QPoint& pos);
  61. protected:
  62. void timerEvent(QTimerEvent* event) override;
  63. void mousePressEvent(QMouseEvent* event) override;
  64. void mouseMoveEvent(QMouseEvent* event) override;
  65. private:
  66. void HideLayout(bool bShow);
  67. void ResetIdleTimer(bool bStart = false);
  68. void InitWnd();
  69. /**创建鼠标控制线程,
  70. * @in isStart== false 关闭
  71. */
  72. void CreateMouseMonitor(bool isStart);
  73. /**鼠标操作
  74. */
  75. void LockMouse(bool islockMouse);
  76. private:
  77. template<class T>
  78. void DeduplicationBox(QComboBox* pCom, const T& veTemp, int nIndex);
  79. private:
  80. Ui::ControlOperationPage* ui;
  81. QPixmap m_currentPixmap;
  82. qreal m_scaleFactor;
  83. QPoint m_mousePos;
  84. OperateMode m_currentMode = ModeImage;
  85. QGraphicsView* m_currentView = nullptr;
  86. double m_previousScaleFactor;
  87. Wafer* m_wafer = nullptr; // 声明Wafer指针
  88. Waffle* m_waffle = nullptr; // 声明Waffle指针
  89. MaterialBox* m_materialbox = nullptr; // 声明materialbox指针
  90. //Bond *m_bond;
  91. /**用作定时使用,后面移动到整个类里面,目前先实现功能
  92. */
  93. int m_idleTimer = -1;
  94. private:
  95. JMouseMonitorThread* m_pMousethread = nullptr;
  96. bool m_bMouseRun = false; // 重复点击
  97. /**硬件指针
  98. */
  99. QPointer<CameraBind> m_pCameraBindCopy;
  100. };
  101. #endif // VIEWWIDGETGROUP_H