|
|
#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"
|
|
|
#include "RecipeAttrObj.h"
|
|
|
#include "MyQGraphicsEllipseItem.h"
|
|
|
#include "MyQGraphicsLineItem.h"
|
|
|
|
|
|
|
|
|
class MAPPINGCHART_EXPORT MappingUI : public QWidget
|
|
|
{
|
|
|
Q_OBJECT
|
|
|
enum Direct {
|
|
|
LEFT,
|
|
|
RIGHT,
|
|
|
UP,
|
|
|
DOWN
|
|
|
};
|
|
|
public:
|
|
|
MappingUI(QWidget *parent = Q_NULLPTR);
|
|
|
~MappingUI();
|
|
|
public:
|
|
|
void UseRecipeMappingAndGetCoord(RecipeAttrObj recipeObj, bool isShowDieText); //设置recipe之后,自动drawMapping,就可以显示晶圆布局
|
|
|
void SetLabelHide();
|
|
|
void SetMappingToInitStatus();
|
|
|
|
|
|
//获取当前区域所有die
|
|
|
void GetCurAreaAllDie(std::vector<std::shared_ptr<MyQGraphicsRectItem>>& outCurAreaDie);
|
|
|
|
|
|
//更新mapping图,标记已经标刻了的
|
|
|
void UpdateMappingArea(int areaIdX, int areaidY);
|
|
|
//diemark界面更新已经标刻了的
|
|
|
void DieMarkUIUpdateAlreadyMark();
|
|
|
|
|
|
void CommonClearSelectDie();
|
|
|
|
|
|
//增加被选择的Die
|
|
|
void AddSelectDie(std::shared_ptr<MyQGraphicsRectItem>& selectDie);
|
|
|
|
|
|
private:
|
|
|
//绘图和得到坐标
|
|
|
void DrawMapping();
|
|
|
|
|
|
//基准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(std::shared_ptr<MyQGraphicsRectItem>& die);
|
|
|
|
|
|
//计算分成多少个区域,每个区域横竖die的个数
|
|
|
void CountAreaData();
|
|
|
|
|
|
//清除场景和存储数据
|
|
|
void ClearSceneAndVec();
|
|
|
|
|
|
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);
|
|
|
void slot_clearCurSelect();
|
|
|
void slot_addCurRow();
|
|
|
void slot_addCurRol();
|
|
|
void slot_addCurArea();
|
|
|
|
|
|
public:
|
|
|
std::vector<std::shared_ptr<MyQGraphicsRectItem>> m_allDieItem;
|
|
|
|
|
|
int m_areaXDirDieNum = 0; //每个区域X方向的die个数
|
|
|
int m_areaYDirDieNum = 0; //每个区域Y方向的die个数
|
|
|
int m_areaGridNum = -1; //一整个晶圆分成多少个区域进行标刻
|
|
|
double m_areaStartX = 0.0; //区域计算左上角开始的点
|
|
|
double m_areaStartY = 0.0; //区域计算左上角开始的点
|
|
|
|
|
|
double m_curDieCoordX = 0.0;
|
|
|
double m_curDieCoordY = 0.0;
|
|
|
int m_curAreaIdX = -1;
|
|
|
int m_curAreaIdY = -1;
|
|
|
std::shared_ptr<MyQGraphicsRectItem> m_curDie = nullptr;
|
|
|
std::vector<std::shared_ptr<MyQGraphicsRectItem>> m_selectDieVec; //选中的所有die
|
|
|
|
|
|
double m_dieMaxYcoord = 0.0; //dieY方向坐标最大值,用于排序
|
|
|
double m_dieMinYccord = 0.0;//dieY方向坐标最小值,用于排序
|
|
|
|
|
|
RecipeAttrObj m_recipeAttrObj;
|
|
|
bool m_isShowDieText = false;
|
|
|
|
|
|
private:
|
|
|
bool m_isScale = false;
|
|
|
double m_scaleFactor = 1.6;
|
|
|
|
|
|
QGraphicsScene m_mappingScene; // 创建场景
|
|
|
std::shared_ptr<MyQGraphicsLineItem> m_baseLineXCoordObj = nullptr; //场景视图的基准线
|
|
|
std::vector<std::shared_ptr<QGraphicsEllipseItem>> m_ellipseItem; //晶圆图形
|
|
|
std::vector<std::shared_ptr<QGraphicsLineItem>> m_allLineItem; //场景线段
|
|
|
|
|
|
|
|
|
};
|