Wafer.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. #ifndef WAFER_H
  2. #define WAFER_H
  3. #pragma once
  4. #include <QWidget>
  5. #include <vector>
  6. #include <QMenu>
  7. #include "WaferGraphicsView.h"
  8. #include "DieItem.h"
  9. #include <CWaferMatrix.h>
  10. #include <CViewInterface.h>
  11. #include "TypeDef.h"
  12. #include <QImage>
  13. #include <QPixmap>
  14. enum OperateMode {
  15. ModeImage, // 显示图片
  16. ModeView // 显示 view
  17. };
  18. class Wafer : public QWidget
  19. {
  20. Q_OBJECT
  21. public:
  22. explicit Wafer(int flag, QWidget *parent = nullptr);
  23. void UpdataGenerateTestData();
  24. /**晶圆
  25. */
  26. void UpdataVal(const std::vector<ns_mat::WAFER_MATRIX_POINT_INFO_STRUCT>& veWafer);
  27. void initFrom(QWidget *parent);
  28. void paintInitFrom(QWidget *parent);
  29. QPixmap getGlobalPixmap() const;
  30. QColor getColorByStatus(ns_mat::PICK_DIE_STATUS status);
  31. void setWaferInfo(ns_module::CViewInterface* CViewInterface);
  32. QPixmap convertToPixmap(const ImageInfo& imgData);
  33. void yuv422_to_rgb888(const unsigned char* src, unsigned char* dst, int width, int height);
  34. typedef struct {
  35. int maxRow;
  36. int maxCol;
  37. double minX;
  38. double minY;
  39. double maxX;
  40. double maxY;
  41. }MaxRow_Col;
  42. signals:
  43. void sendCoordinates(int x, int y);
  44. private:
  45. int Flag;
  46. QVector<ns_mat::WAFER_MATRIX_POINT_INFO_STRUCT> waferData;
  47. //int rows, cols;
  48. int m_dieLong;
  49. int m_dieWide;
  50. double m_centerX, m_centerY;
  51. double m_radius;
  52. /**接口指针
  53. */
  54. ns_module::CViewInterface* m_pCViewInterface;
  55. QMenu *contextMenu = nullptr;
  56. QPixmap globalPixmap;
  57. QMap<UINT, MaxRow_Col> maxRow_Colmap;
  58. public:
  59. QGraphicsScene* scene = nullptr;
  60. WaferGraphicsView* view = nullptr;
  61. };
  62. #endif // WAFER_H