|
@@ -55,43 +55,26 @@ void Waffle::UpdataGenerateTestData()
|
|
|
|
|
|
void Waffle::UpdataVal(const std::vector<ns_mat::WAFFLE_MATRIX_POINT_STRUCT>& veWaffle)
|
|
|
{
|
|
|
- maxRow = 0;
|
|
|
- maxCol = 0;
|
|
|
- waffleMatrixRowNum = 0;
|
|
|
- waffleMatrixColNum = 0;
|
|
|
- matrixInfo mInfo;
|
|
|
- mInfo.maxCol = 0;
|
|
|
- mInfo.maxRow = 0;
|
|
|
- UINT dieMatrixId = veWaffle[0].nDieMatrixId;
|
|
|
+
|
|
|
+
|
|
|
+ maxPoint = QPointF(veWaffle[0].stPosition.x, veWaffle[0].stPosition.y);
|
|
|
+ minPoint = QPointF(veWaffle[0].stPosition.x, veWaffle[0].stPosition.y);
|
|
|
for (const auto a: veWaffle)
|
|
|
{
|
|
|
- if (dieMatrixId != a.nDieMatrixId) {
|
|
|
- matrixInfoMap.insert(dieMatrixId, mInfo);
|
|
|
- dieMatrixId = a.nPackMatrixId;
|
|
|
- mInfo.maxCol = 0;
|
|
|
- mInfo.maxRow = 0;
|
|
|
- }
|
|
|
- else {
|
|
|
- if (mInfo.maxRow < a.nDieRow)
|
|
|
- mInfo.maxRow = a.nDieRow;
|
|
|
- if (mInfo.maxCol < a.nDieCol)
|
|
|
- mInfo.maxCol = a.nDieCol;
|
|
|
-
|
|
|
- }
|
|
|
m_vWaffleData.append(a);
|
|
|
- if (a.nPackRow == 1 && a.nDieRow==1) {
|
|
|
- waffleMatrixRowNum++;
|
|
|
- }
|
|
|
- if (a.nPackCol == 1 && a.nDieCol == 1) {
|
|
|
- waffleMatrixColNum++;
|
|
|
- }
|
|
|
- if (maxRow < a.nPackRow)
|
|
|
- maxRow = a.nPackRow;
|
|
|
- if (maxCol < a.nPackCol)
|
|
|
- maxCol = a.nPackCol;
|
|
|
+ //遍历找到最小和最大边界点
|
|
|
+ if (a.stPosition.x > maxPoint.x())
|
|
|
+ maxPoint.setX(a.stPosition.x);
|
|
|
+ if (a.stPosition.x < minPoint.x())
|
|
|
+ minPoint.setX(a.stPosition.x);
|
|
|
+ if (a.stPosition.y > maxPoint.y())
|
|
|
+ maxPoint.setY(a.stPosition.y);
|
|
|
+ if (a.stPosition.y < minPoint.y())
|
|
|
+ minPoint.setY(a.stPosition.y);
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
- matrixInfoMap.insert(dieMatrixId, mInfo);
|
|
|
- qDebug() << maxRow << maxCol << waffleMatrixRowNum << waffleMatrixColNum;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
void Waffle::paintEvent(QPaintEvent *event) {
|
|
@@ -147,18 +130,9 @@ void Waffle::drawWaffle(QPainter &painter, int startX, int startY, int rows, int
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-QColor Waffle::getColorByStatus(ns_mat::PICK_DIE_STATUS status) {
|
|
|
- switch (status) {
|
|
|
- case ns_mat::PICK_DIE_STATUS::DIE_EXIST: return QColor(0, 102, 255); // 蓝色
|
|
|
- case ns_mat::PICK_DIE_STATUS::NO_EXIST: return QColor(200, 200, 200); // 浅灰
|
|
|
- case ns_mat::PICK_DIE_STATUS::PICK_ING: return QColor(255, 255, 0); // 黄色
|
|
|
- case ns_mat::PICK_DIE_STATUS::SKIP_DIE: return QColor(128, 128, 128); // 深灰
|
|
|
- case ns_mat::PICK_DIE_STATUS::EDGE_DIE: return QColor(255, 165, 0); // 橙色
|
|
|
- default: return QColor(0, 0, 0); // 默认黑色
|
|
|
- }
|
|
|
-}
|
|
|
-void Waffle::paintInitFrom(QWidget *parent) {
|
|
|
|
|
|
+void Waffle::paintInitFrom(QWidget *parent) {
|
|
|
+ /*
|
|
|
// 获取当前窗口的宽高
|
|
|
int width = parent->width();
|
|
|
int height = parent->height();
|
|
@@ -197,27 +171,66 @@ void Waffle::paintInitFrom(QWidget *parent) {
|
|
|
// painter.setBrush(Qt::black);
|
|
|
// painter.drawEllipse(centerX - 3, centerY - 3, 6, 6);
|
|
|
painter.end(); // 结束绘制
|
|
|
+ */
|
|
|
}
|
|
|
+
|
|
|
void Waffle::initFrom(QWidget *parent) {
|
|
|
scene = new QGraphicsScene(parent);
|
|
|
view = new WaffleGraphicsView(scene);
|
|
|
- /*
|
|
|
- // 获取当前窗口的宽高
|
|
|
+ view->setCViewInterface(m_pCViewInterface);
|
|
|
+
|
|
|
int width = parent->width();
|
|
|
int height = parent->height();
|
|
|
+ double maxWidth = maxPoint.x() - minPoint.x();
|
|
|
+ double maxHeight = maxPoint.y() - minPoint.y();
|
|
|
+ double ratio;
|
|
|
|
|
|
- // 根据行列数计算每个晶圆点的大小,选择小的边来决定
|
|
|
- int cellSize = qMin(width, height) / qMax(rows, cols); // 固定大小为正方形,按最小边计算
|
|
|
+ if (maxHeight > maxWidth) {
|
|
|
+ ratio = maxHeight / (width - 100);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ ratio = maxWidth / (width - 100);
|
|
|
+ }
|
|
|
|
|
|
+ //目前没提供固晶点大小,以下用测试大小,后续可替换(实际大小,接口替换处)
|
|
|
+ double dieWidth = 20000;
|
|
|
+ double dieHeight = 20000;
|
|
|
for (int i = 0; i < m_vWaffleData.size(); ++i) {
|
|
|
- DieItem* die = new DieItem(m_vWaffleData[i].nDieRow, m_vWaffleData[i].nDieCol, m_vWaffleData[i].eStatus, cellSize);
|
|
|
- die->setPos(m_vWaffleData[i].nDieCol * cellSize, m_vWaffleData[i].nDieRow * cellSize);
|
|
|
- scene->addItem(die);
|
|
|
- }
|
|
|
|
|
|
- view->setSceneRect(scene->itemsBoundingRect());
|
|
|
- view->resize(width, height);
|
|
|
- */
|
|
|
+ // 绘制固晶点
|
|
|
+
|
|
|
+ //转换大小
|
|
|
+ double dieWidthr = dieWidth / ratio;
|
|
|
+ double dieHeightr = dieHeight / ratio;
|
|
|
+ double diex, diey;
|
|
|
+ diex = (m_vWaffleData[i].stPosition.x - minPoint.x() + dieWidth) / ratio;
|
|
|
+ diey = (m_vWaffleData[i].stPosition.y - minPoint.y() + dieHeight) / ratio;
|
|
|
+
|
|
|
+
|
|
|
+ // 计算固晶点位置
|
|
|
+ QRectF dieRect(
|
|
|
+ diex,
|
|
|
+ diey,
|
|
|
+ dieWidthr,
|
|
|
+ dieHeightr
|
|
|
+ );
|
|
|
+ WaffleItem* dieItem = new WaffleItem(m_vWaffleData[i]);
|
|
|
+ dieItem->setRect(dieRect);
|
|
|
+ dieItem->setZValue(1.0);
|
|
|
+ scene->addItem(dieItem);
|
|
|
+ /*
|
|
|
+ // 添加固晶点编号
|
|
|
+ QGraphicsTextItem* dieText = new QGraphicsTextItem(dieItem);
|
|
|
+ dieText->setPlainText("PT" + QString::number(m_vWaffleData[i].stIndex.iIndex));
|
|
|
+ double dieFontSize = qMin(dieWidthr, dieHeightr) * 0.2;
|
|
|
+ QFont font;
|
|
|
+ font.setPointSizeF(dieFontSize); // 使用浮点大小
|
|
|
+ dieText->setFont(font);
|
|
|
+ dieText->setPos(dieRect.center() - QPointF(dieText->boundingRect().width() / 2,
|
|
|
+ dieText->boundingRect().height() / 2));
|
|
|
+ */
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
QPixmap Waffle::getGlobalPixmap() const {
|
|
|
return globalPixmap;
|