Wafer.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #ifndef WAFER_H
  2. #define WAFER_H
  3. #include <QWidget>
  4. #include <vector>
  5. #include <QMenu>
  6. #include "WaferGraphicsView.h"
  7. #include "DieItem.h"
  8. enum OperateMode {
  9. ModeImage, // 显示图片
  10. ModeView // 显示 view
  11. };
  12. typedef struct
  13. {
  14. double x;
  15. double y;
  16. }XY_DOUBLE_STRUCT;
  17. typedef struct
  18. {
  19. int nDieMatrixId; //晶圆矩阵Id
  20. int nDieRow; //固晶点在矩阵中所在行
  21. int nDieCol; //固晶点在矩阵中所在列
  22. int iDieIndex; //所在Point点ID
  23. bool bDisable; //不可用点,等同于无效点
  24. PICK_DIE_STATUS eStatus; //晶片状态
  25. XY_DOUBLE_STRUCT stPosition; //程序设置的位置
  26. } WAFER_MATRIX_POINT_INFO_STRUCT;
  27. class Wafer : public QWidget
  28. {
  29. Q_OBJECT
  30. public:
  31. explicit Wafer(int flag, QWidget *parent = nullptr);
  32. void initFrom(QWidget *parent);
  33. void paintInitFrom(QWidget *parent);
  34. QPixmap getGlobalPixmap() const;
  35. QColor getColorByStatus(PICK_DIE_STATUS status);
  36. QGraphicsScene* scene;
  37. WaferGraphicsView *view;
  38. protected:
  39. private slots:
  40. void handleAction1();
  41. void handleAction2();
  42. signals:
  43. void sendCoordinates(int x, int y);
  44. private:
  45. int Flag;
  46. void showContextMenu(const QPoint &pos);
  47. QVector<WAFER_MATRIX_POINT_INFO_STRUCT> waferData;
  48. int rows, cols;
  49. int centerX, centerY;
  50. qreal radius;
  51. QMenu *contextMenu = nullptr;
  52. QPixmap globalPixmap;
  53. };
  54. #endif // WAFER_H