You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
97 lines
2.2 KiB
C++
97 lines
2.2 KiB
C++
#pragma once
|
|
|
|
#include <QWidget>
|
|
#include <QGraphicsScene>
|
|
#include <QGraphicsView>
|
|
#include <QGraphicsRectItem>
|
|
#include <memory>
|
|
#include <vector>
|
|
#include <cmath>
|
|
#include <QDebug>
|
|
#include <QWheelEvent>
|
|
#include <QTransform>
|
|
#include "ui_MappingUI.h"
|
|
#include "mappingchart_global.h"
|
|
#include "MyQGraphicsRectItem.h"
|
|
#include <QGraphicsLineItem>
|
|
#include "global.h"
|
|
|
|
|
|
class MAPPINGCHART_EXPORT MappingUI : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
enum Direct {
|
|
LEFT,
|
|
RIGHT,
|
|
UP,
|
|
DOWN
|
|
};
|
|
public:
|
|
MappingUI(QWidget *parent = Q_NULLPTR);
|
|
~MappingUI();
|
|
public:
|
|
void SetRecipe(double waferDia,
|
|
double dieWidth,
|
|
double dieHeight,
|
|
double baseDiePosX,
|
|
double baseDiePosY,
|
|
double markPoint1X,
|
|
double markPoint1Y,
|
|
double markPoint2X,
|
|
double markPoint2Y,
|
|
int areaXDirectionNum,
|
|
int areaYDirectionNum);
|
|
void DrawMapping();
|
|
void SetWaferRecipe(MaferRecipe& maferRecipe);
|
|
|
|
private:
|
|
//基准die往左侧延伸
|
|
void LeftExtend(double firstX, double firstY);
|
|
|
|
//基准die往右侧延伸
|
|
void RightExtend(double firstX, double firstY, bool isIncludeCur);
|
|
|
|
//添加die矩形
|
|
void AddDieRect(double xCoord, double yCoord);
|
|
|
|
void SetDieAttr(std::shared_ptr<MyQGraphicsRectItem>& dieObj, bool isBase, bool isMark, double xCoord, double yCoord);
|
|
|
|
//判断延伸是否超过界限
|
|
bool JudgeIsInWafer(double xCoord, double yCoord);
|
|
|
|
//判断是不是mark点
|
|
bool JudgeIsMark(double xCoord, double yCoord);
|
|
|
|
//计算区域die的个数
|
|
void CountDieNumInArea();
|
|
|
|
protected:
|
|
virtual void wheelEvent(QWheelEvent *event) override;
|
|
virtual void mousePressEvent(QMouseEvent *event) override;
|
|
private:
|
|
Ui::MappingUI ui;
|
|
|
|
public slots:
|
|
void slot_UpdateAllDieStatus(double xCoord, double yCoord);
|
|
|
|
public:
|
|
// 创建场景
|
|
QGraphicsScene m_scene;
|
|
double m_scaleFactor = 3;
|
|
std::vector<std::shared_ptr<MyQGraphicsRectItem>> m_allDieItem;
|
|
std::vector<std::shared_ptr<QGraphicsEllipseItem>> m_ellipseItem;
|
|
//场景线段
|
|
std::vector<std::shared_ptr<QGraphicsLineItem>> m_allLineItem;
|
|
|
|
int m_realAreaXNum = 0; //每个区域X方向的个数
|
|
int m_readAreaYNum = 0; //每个区域Y方向的个数
|
|
|
|
double m_areaStartX = 0.0; //区域计算左上角开始的点
|
|
double m_areaStartY = 0.0; //区域计算左上角开始的点
|
|
|
|
private:
|
|
MaferRecipe m_maferRecipe;
|
|
int ZERO = 0.00001;
|
|
|
|
};
|