|
@@ -12,6 +12,7 @@ Wafer::Wafer(int flag, QWidget *parent) : QWidget(parent) {
|
|
|
|
|
|
void Wafer::UpdataGenerateTestData()
|
|
|
{
|
|
|
+ /*
|
|
|
Flag = 0;
|
|
|
rows = 51;
|
|
|
cols = 51;
|
|
@@ -59,21 +60,44 @@ void Wafer::UpdataGenerateTestData()
|
|
|
waferData.append(point);
|
|
|
}
|
|
|
}
|
|
|
+ */
|
|
|
}
|
|
|
|
|
|
void Wafer::UpdataVal(const std::vector<ns_mat::WAFER_MATRIX_POINT_INFO_STRUCT>& veWafer)
|
|
|
{
|
|
|
+ int currentDieMatrixId = veWafer[0].nDieMatrixId;
|
|
|
+ int rowMax = veWafer[0].nDieRow;
|
|
|
+ int colsMax = veWafer[0].nDieCol;
|
|
|
+ double minx = veWafer[0].stPosition.x;
|
|
|
+ double miny = veWafer[0].stPosition.y;
|
|
|
+ double maxx = veWafer[0].stPosition.x;
|
|
|
+ double maxy = veWafer[0].stPosition.y;
|
|
|
for (const auto a : veWafer)
|
|
|
{
|
|
|
waferData.append(a);
|
|
|
+ qDebug() << a.stPosition.x << " " << a.stPosition.y;
|
|
|
+ if (a.nDieMatrixId != currentDieMatrixId) {
|
|
|
+ maxRow_Colmap.insert(currentDieMatrixId, { rowMax ,colsMax,minx,miny,maxx,maxy });
|
|
|
+ currentDieMatrixId = a.nDieMatrixId;
|
|
|
+ rowMax = a.nDieRow;
|
|
|
+ colsMax = a.nDieCol;
|
|
|
+ minx = a.stPosition.x;
|
|
|
+ maxx = a.stPosition.x;
|
|
|
+ miny = a.stPosition.y;
|
|
|
+ maxy = a.stPosition.y;
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ if (a.nDieRow >= rowMax) rowMax = a.nDieRow;
|
|
|
+ if (a.nDieCol >= colsMax) colsMax = a.nDieCol;
|
|
|
+ if (a.stPosition.x >= maxx) maxx = a.stPosition.x;
|
|
|
+ if (a.stPosition.y <= maxx) maxx = a.stPosition.y;
|
|
|
+ if (a.stPosition.x >= minx) minx = a.stPosition.x;
|
|
|
+ if (a.stPosition.x <= miny) miny = a.stPosition.y;
|
|
|
+ }
|
|
|
}
|
|
|
+ maxRow_Colmap.insert(currentDieMatrixId, { rowMax ,colsMax,minx,miny,maxx,maxy });
|
|
|
+
|
|
|
|
|
|
- rows = 0;
|
|
|
- cols = 0;
|
|
|
- for (const auto& point : waferData) {
|
|
|
- if (point.nDieRow >= rows) rows = point.nDieRow + 1;
|
|
|
- if (point.nDieCol >= cols) cols = point.nDieCol + 1;
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
QColor Wafer::getColorByStatus(ns_mat::PICK_DIE_STATUS status) {
|
|
@@ -88,7 +112,7 @@ QColor Wafer::getColorByStatus(ns_mat::PICK_DIE_STATUS status) {
|
|
|
}
|
|
|
|
|
|
void Wafer::paintInitFrom(QWidget *parent) {
|
|
|
-
|
|
|
+ /*
|
|
|
// 获取当前窗口的宽高
|
|
|
int width = parent->width();
|
|
|
int height = parent->height();
|
|
@@ -152,29 +176,84 @@ void Wafer::paintInitFrom(QWidget *parent) {
|
|
|
painter.setBrush(Qt::black);
|
|
|
painter.drawEllipse(centerX - 3, centerY - 3, 6, 6);
|
|
|
painter.end(); // 结束绘制
|
|
|
+ */
|
|
|
}
|
|
|
|
|
|
-void Wafer::initFrom(QWidget *parent) {
|
|
|
- scene = new QGraphicsScene(parent);
|
|
|
- view = new WaferGraphicsView(scene);
|
|
|
+void Wafer::initFrom(QWidget* parent) {
|
|
|
+ //scene = new QGraphicsScene(parent);
|
|
|
+ //view = new WaferGraphicsView(scene);
|
|
|
|
|
|
- // 获取当前窗口的宽高
|
|
|
- int width = parent->width();
|
|
|
- int height = parent->height();
|
|
|
+ //// 获取当前窗口的宽高
|
|
|
+ double width = parent->width();
|
|
|
+ double height = parent->height();
|
|
|
|
|
|
- // 根据行列数计算每个晶圆点的大小,选择小的边来决定
|
|
|
- int cellSize = qMin(width, height) / qMax(rows, cols); // 固定大小为正方形,按最小边计算
|
|
|
+ //// 根据行列数计算每个晶圆点的大小,选择小的边来决定
|
|
|
+ //int cellSize = qMin(width, height) / qMax(rows, cols); // 固定大小为正方形,按最小边计算
|
|
|
|
|
|
- for (int i = 0; i < waferData.size(); ++i) {
|
|
|
- DieItem* die = new DieItem(waferData[i].nDieRow, waferData[i].nDieCol, waferData[i].eStatus, cellSize);
|
|
|
- die->setPos(waferData[i].nDieCol * cellSize, waferData[i].nDieRow * cellSize);
|
|
|
- scene->addItem(die);
|
|
|
- }
|
|
|
+ //for (int i = 0; i < waferData.size(); ++i) {
|
|
|
+ // DieItem* die = new DieItem(waferData[i].nDieRow, waferData[i].nDieCol, waferData[i].eStatus, cellSize);
|
|
|
+ // die->setPos(waferData[i].nDieCol * cellSize, waferData[i].nDieRow * cellSize);
|
|
|
+ // scene->addItem(die);
|
|
|
+ //}
|
|
|
+
|
|
|
+ //view->setSceneRect(scene->itemsBoundingRect());
|
|
|
+ //view->resize(width, height);
|
|
|
|
|
|
- view->setSceneRect(scene->itemsBoundingRect());
|
|
|
+ // 创建视图
|
|
|
+ scene = new QGraphicsScene(parent);
|
|
|
+ view = new WaferGraphicsView(scene);
|
|
|
view->resize(width, height);
|
|
|
+ QPointF center(width / 2.0, height / 2.0);
|
|
|
+ QPointF pointf(m_centerX, m_centerY);
|
|
|
+ double radius = width / 2 - 10;
|
|
|
+ //比例
|
|
|
+ double radio = m_radius / radius;
|
|
|
+ int dieLong = m_dieLong / radio;
|
|
|
+ int dieWide = m_dieWide / radio;
|
|
|
+ // 初始化晶圆参数
|
|
|
+ view->initWafer(center, // 中心坐标
|
|
|
+ radius, // 半径
|
|
|
+ dieLong, dieWide); // 固晶点显示尺寸
|
|
|
+
|
|
|
+// 添加固晶点
|
|
|
+ int currentDieMatrixId = -1;
|
|
|
+ double referPointX = 0.0;
|
|
|
+ double referPointY = 0.0;
|
|
|
+ MaxRow_Col maxRow_Col;
|
|
|
+ for (int i = 0; i < waferData.size(); ++i) {
|
|
|
+ //判断是否属于同一个矩阵
|
|
|
+ if (waferData[i].nDieMatrixId != currentDieMatrixId) {
|
|
|
+ //重新画矩阵框然后配置新的参考点
|
|
|
+ currentDieMatrixId = waferData[i].nDieMatrixId;
|
|
|
+ referPointX = center.x() + (waferData[i].stPosition.x - m_centerX) / radio;
|
|
|
+ referPointY = center.y() - (waferData[i].stPosition.y - m_centerY) / radio;
|
|
|
+ maxRow_Col = maxRow_Colmap.value(currentDieMatrixId);
|
|
|
+ view->drawDieMatrix(QPointF(referPointX - dieLong, referPointY - dieWide), (maxRow_Col.maxRow+2) * dieLong, (maxRow_Col.maxCol+2) * dieWide);
|
|
|
+
|
|
|
+ }
|
|
|
+ referPointX = center.x() + (waferData[i].stPosition.x - m_centerX) / radio;
|
|
|
+ referPointY = center.y() - (waferData[i].stPosition.y - m_centerY) / radio;
|
|
|
+ view->addDiePoint(QPointF(referPointX, referPointY),waferData[i]);
|
|
|
+ }
|
|
|
+ scene->setSceneRect(0, 0, view->width(), view->height());
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
QPixmap Wafer::getGlobalPixmap() const {
|
|
|
return globalPixmap;
|
|
|
}
|
|
|
+
|
|
|
+void Wafer::setWaferInfo(ns_module::CViewInterface* CViewInterface) {
|
|
|
+ m_pCViewInterface = CViewInterface;
|
|
|
+ long result = m_pCViewInterface->GetViewMatrix()->GetDieSize(m_dieLong,m_dieWide);
|
|
|
+
|
|
|
+ m_pCViewInterface->GetViewMatrix()->GetWaferSize(m_centerX, m_centerY,m_radius);
|
|
|
+
|
|
|
+ //这里到时候更新接口时替换真实圆心点的数据
|
|
|
+ /*m_dieLong = 10;
|
|
|
+ m_dieWide = 10;
|
|
|
+ m_radius = 200;*/
|
|
|
+ m_centerX = 0;
|
|
|
+ m_centerY = 0;
|
|
|
+}
|