ControlOperationPage.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. namespace Ui {
  13. class ControlOperationPage;
  14. }
  15. class ControlOperationPage : public QWidget
  16. {
  17. Q_OBJECT
  18. public:
  19. enum kinds{
  20. wafer_kind,
  21. waffle_kind,
  22. materialbox_kind,
  23. bond_kind
  24. };
  25. explicit ControlOperationPage(QWidget *parent = nullptr);
  26. ~ControlOperationPage();
  27. void initForm();
  28. void updateOperateWidget(const QPixmap& pixmap, const QStringList& textList);
  29. void clearLayout();
  30. void updateScale(double newScaleFactor);
  31. void applyScale();
  32. void updateMaterialWidget( kinds materialWndType);
  33. void KindsofWidget(kinds kind);
  34. void setWafer(Wafer *wafer);
  35. void setWaffle(Waffle *waffle);
  36. void setMaterialBox(MaterialBox *materialbox);
  37. //void setBond(Bond *bond);
  38. ImageWidget* getOperatewidget();
  39. private slots:
  40. void on_ZoomUpButton_clicked();
  41. void on_ZoomOutButton_clicked();
  42. // void on_RulerButton_clicked();
  43. //void on_PenButton_clicked();
  44. void handleDoubleClick();
  45. void on_switchJoystickBut_clicked();
  46. protected:
  47. void timerEvent(QTimerEvent* event) override;
  48. private:
  49. void HideLayout(bool bShow);
  50. void ResetIdleTimer(bool bStart = false);
  51. private:
  52. template<class T>
  53. void DeduplicationBox(QComboBox* pCom, const T& veTemp, int nIndex);
  54. private:
  55. Ui::ControlOperationPage* ui;
  56. QPixmap m_currentPixmap;
  57. qreal m_scaleFactor;
  58. QPoint m_mousePos;
  59. OperateMode m_currentMode = ModeImage;
  60. QGraphicsView* m_currentView = nullptr;
  61. double m_previousScaleFactor;
  62. Wafer* m_wafer; // 声明Wafer指针
  63. Waffle* m_waffle; // 声明Waffle指针
  64. MaterialBox* m_materialbox; // 声明materialbox指针
  65. //Bond *m_bond;
  66. /**用作定时使用,后面移动到整个类里面,目前先实现功能
  67. */
  68. int m_idleTimer = -1;
  69. };
  70. #endif // VIEWWIDGETGROUP_H