Explorar o código

同步修改代码

yun hai 1 semana
pai
achega
9e32d76dc7

+ 0 - 1
View/die-bonder-ui/CameraMaterialGroupWnd/CameraImage/CameraImageHandler.h

@@ -24,7 +24,6 @@ public:
     Wafer* getWafer() const;
     Waffle* getWaffle() const;
     MaterialBox* getMaterialBox() const;
-
     Bond* getBond() const;
 
 private:

+ 3 - 0
View/die-bonder-ui/CameraMaterialGroupWnd/Group.h

@@ -6,6 +6,7 @@
 #include "CameraMaterialGroupWnd/MaterialWindow/Wafer.h"
 #include "CameraMaterialGroupWnd/MaterialWindow/Waffle.h"
 #include "CameraMaterialGroupWnd/MaterialWindow/MaterialBox.h"
+#include "CameraMaterialGroupWnd/MaterialWindow/Bond.h"
 
 namespace Ui {
 class Group;
@@ -60,6 +61,7 @@ protected:
     void WaferWidget(); // 圆晶
     void WaffleWidget(); // 华夫盒
     void MaterialBoxWidget(); // 料盒
+    void BondWidget();
 
 private:
     Ui::Group *ui;
@@ -68,6 +70,7 @@ private:
     Wafer *         m_pWafer        =nullptr; // 声明Wafer指针
     Waffle *        m_pWaffle       = nullptr; // 声明Waffle指针
     MaterialBox *   m_pMaterialbox  = nullptr; // 声明materialbox指针
+    Bond*           m_pBond         = nullptr;
     static Group*   m_pCurrentlySelectedGroup; // 当前选中(红色边框)的实例
     static Group*   m_pPreviouslySelectedBlueGroup; // 上一次选中且边框为蓝色的实例
     static Group*   m_pLastClickedGroup; // 上一次点击的实例

+ 53 - 154
View/die-bonder-ui/CameraMaterialGroupWnd/MaterialWindow/BondGraphicsView.cpp

@@ -1,6 +1,9 @@
 #include "BondGraphicsView.h"
+#include <QMouseEvent>
+#include <QGraphicsRectItem>
 #include <QDebug>
 #include <QScrollBar>
+#include <QMenu>
 
 BondItem::BondItem(ns_mat::POINT_INFO_STRUCT point, QGraphicsItem* parent)
     : QGraphicsRectItem(parent), point(point) {
@@ -53,21 +56,20 @@ BondGraphicsView::BondGraphicsView(QGraphicsScene* scene, QWidget* parent)
     thumbnailLabel->setStyleSheet("background-color: white; border: 1px solid gray;");
     thumbnailLabel->installEventFilter(this);
     thumbnailLabel->hide();
-
-    topLeftIndex = qMakePair(-1, -1);
-    bottomRightIndex = qMakePair(-1, -1);
 }
 
+
 // 事件过滤器用于处理缩略图拖动
-bool BondGraphicsView::eventFilter(QObject *obj, QEvent *event) {
+bool BondGraphicsView::eventFilter(QObject* obj, QEvent* event) {
     static QPoint dragStartPosition;
     if (obj == thumbnailLabel) {
         if (event->type() == QEvent::MouseButtonPress) {
-            QMouseEvent *me = static_cast<QMouseEvent*>(event);
+            QMouseEvent* me = static_cast<QMouseEvent*>(event);
             dragStartPosition = me->pos();
             return true;
-        } else if (event->type() == QEvent::MouseMove) {
-            QMouseEvent *me = static_cast<QMouseEvent*>(event);
+        }
+        else if (event->type() == QEvent::MouseMove) {
+            QMouseEvent* me = static_cast<QMouseEvent*>(event);
 
             // 计算新位置
             QPoint newPos = thumbnailLabel->pos() + (me->pos() - dragStartPosition);
@@ -89,42 +91,40 @@ bool BondGraphicsView::eventFilter(QObject *obj, QEvent *event) {
 
 void BondGraphicsView::mousePressEvent(QMouseEvent* event) {
     if (event->button() == Qt::LeftButton) {
-        // 清空选中的 DieItem
+        // 清空选中的 BondItem
         for (auto& item : selectedItemsMap) {
-            DieItem* die = dynamic_cast<DieItem*>(item);
+            BondItem* die = dynamic_cast<BondItem*>(item);
             if (die) {
                 die->setSelected(false); // 取消选中状态
             }
         }
         selectedItemsMap.clear();
 
-        if (topLeftItem && topLeftItem->scene()) {
-            topLeftItem->setRightSelected(false);
-        }
-        topLeftItem.clear();
-
-        if (bottomRightItem && bottomRightItem->scene()) {
-            bottomRightItem->setRightSelected(false);
-        }
-        bottomRightItem.clear();
-        topLeftIndex = qMakePair(-1, -1);
-        bottomRightIndex = qMakePair(-1, -1);
-        // 获取点击位置的 DieItem
+        // 获取点击位置的 BondItem
         if (selectedItem && selectedItem->scene()) {
             selectedItem->setLeftSelected(false);
         }
         selectedItem.clear();
         QGraphicsItem* item = itemAt(event->pos());
-        if (item) {
-            selectedItem = dynamic_cast<DieItem*>(item);
+        // if (BondItem* bondItem = dynamic_cast<BondItem*>(item)) {
+        //     selectedItem = bondItem;
+        //     selectedItem->setLeftSelected(true);
+        // }
+        BondItem* bondItem = nullptr;
+        while (item && !bondItem) {
+            bondItem = dynamic_cast<BondItem*>(item);
+            item = item->parentItem();
+        }
+        if (bondItem) {
+            selectedItem = bondItem;
             selectedItem->setLeftSelected(true);
-
         }
 
         setCursor(Qt::OpenHandCursor);  // 按下时设置为小手
         selecting = true;
         lastPos = event->pos();  // 记录鼠标位置
-    } else if (event->button() == Qt::RightButton) {
+    }
+    else if (event->button() == Qt::RightButton) {
         // 开始框选
         selecting = true;
         selectionStart = mapToScene(event->pos());
@@ -145,7 +145,8 @@ void BondGraphicsView::mouseMoveEvent(QMouseEvent* event) {
         QPointF currentPos = mapToScene(event->pos());
         selectionRect->setRect(QRectF(selectionStart, currentPos).normalized());
         isDragging = true;
-    } else if (selecting) {
+    }
+    else if (selecting) {
         // 计算鼠标当前位置与上次位置的差值
         QPointF delta = event->pos() - lastPos;
         // 平移视图
@@ -160,7 +161,8 @@ void BondGraphicsView::mouseReleaseEvent(QMouseEvent* event) {
     if (event->button() == Qt::LeftButton) {
         setCursor(Qt::ArrowCursor);  // 松开时恢复为箭头
         selecting = false;
-    } else if (event->button() == Qt::RightButton && selecting) {
+    }
+    else if (event->button() == Qt::RightButton && selecting) {
         selecting = false;
         if (selectionRect && isDragging) {
             if (selectedItem && selectedItem->scene()) {
@@ -168,17 +170,6 @@ void BondGraphicsView::mouseReleaseEvent(QMouseEvent* event) {
             }
             selectedItem.clear();
 
-            if (topLeftItem && topLeftItem->scene()) {
-                topLeftItem->setRightSelected(false);
-            }
-            topLeftItem.clear();
-
-            if (bottomRightItem && bottomRightItem->scene()) {
-                bottomRightItem->setRightSelected(false);
-            }
-            bottomRightItem.clear();
-            topLeftIndex = qMakePair(-1, -1);
-            bottomRightIndex = qMakePair(-1, -1);
             QRectF selectedArea = selectionRect->rect();
             scene()->removeItem(selectionRect);
             delete selectionRect;
@@ -186,11 +177,9 @@ void BondGraphicsView::mouseReleaseEvent(QMouseEvent* event) {
 
             QList<QGraphicsItem*> items = scene()->items(selectedArea, Qt::IntersectsItemShape);
             for (QGraphicsItem* item : items) {
-                DieItem* die = dynamic_cast<DieItem*>(item);
-                if (die) {
-                    // 将 DieItem 添加到 map 中
-                    selectedItemsMap.insert(qMakePair(die->getRow(), die->getCol()), die);
-                    die->setSelected(true); // 设置选中状态
+                if (BondItem* die = dynamic_cast<BondItem*>(item)) {
+                    selectedItemsMap.insert(die->point.stIndex.iIndex, die);
+                    die->setSelected(true);
                 }
             }
         }
@@ -202,43 +191,34 @@ void BondGraphicsView::mouseReleaseEvent(QMouseEvent* event) {
         // 如果没有进行拖动,则弹出右键菜单
         if (!isDragging) {
             QGraphicsItem* item = itemAt(event->pos());
-            DieItem* die = dynamic_cast<DieItem*>(item);
             QMenu menu;
             QAction* showThumb = menu.addAction(thumbnailVisible ? "隐藏缩略图" : "显示缩略图");
 
-
-            connect(showThumb, &QAction::triggered, [this]{
+            connect(showThumb, &QAction::triggered, [this] {
                 thumbnailVisible ? hideThumbnail() : showThumbnail();
-            });
+                });
             menu.addAction("发送位置", [this] {
                 if (selectedItem) {
-                    qDebug() << "Row:" << selectedItem->getRow() << "Col:" << selectedItem->getCol();
+                    qDebug() << selectedItem->point.stIndex.iIndex;
                     selectedItem->setLeftSelected(false);
                     selectedItem = nullptr;
                 }
-            });
+                });
+            BondItem* die = nullptr;
+            while (item && !die) {
+                die = dynamic_cast<BondItem*>(item);
+                item = item->parentItem();
+            }
             if (die) {
                 menu.addAction("移动到该位置", [this, die] {
                     for (auto& item : selectedItemsMap) {
-                        DieItem* die = dynamic_cast<DieItem*>(item);
+                        BondItem* die = dynamic_cast<BondItem*>(item);
                         if (die) {
                             die->setSelected(false);
                         }
                     }
                     selectedItemsMap.clear();
 
-                    if (topLeftItem && topLeftItem->scene()) {
-                        topLeftItem->setRightSelected(false);
-                    }
-                    topLeftItem.clear();
-
-                    if (bottomRightItem && bottomRightItem->scene()) {
-                        bottomRightItem->setRightSelected(false);
-                    }
-                    bottomRightItem.clear();
-                    topLeftIndex = qMakePair(-1, -1);
-                    bottomRightIndex = qMakePair(-1, -1);
-
                     if (selectedItem && selectedItem->scene()) {
                         selectedItem->setLeftSelected(false);
                     }
@@ -246,30 +226,7 @@ void BondGraphicsView::mouseReleaseEvent(QMouseEvent* event) {
 
                     selectedItem = die;
                     selectedItem->setLeftSelected(true);
-                });
-
-                // 设置区域边界点菜单
-                menu.addAction("设为左上点", [this, die] {
-                    if (topLeftItem && topLeftItem->scene()) {
-                        topLeftItem->setRightSelected(false);
-                    }
-                    topLeftItem.clear();
-                    topLeftItem = die;
-                    topLeftItem->setRightSelected(true);
-                    topLeftIndex = qMakePair(die->getRow(), die->getCol());
-                    if (bottomRightIndex.first >= 0) checkAndCreateRegion();
-                });
-
-                menu.addAction("设为右下点", [this, die] {
-                    if (bottomRightItem && bottomRightItem->scene()) {
-                        bottomRightItem->setRightSelected(false);
-                    }
-                    bottomRightItem.clear();
-                    bottomRightItem = die;
-                    bottomRightItem->setRightSelected(true);
-                    bottomRightIndex = qMakePair(die->getRow(), die->getCol());
-                    if (topLeftIndex.first >= 0) checkAndCreateRegion();
-                });
+                    });
             }
 
             menu.addAction("清除选中区域", [this] { clearRegion(); });
@@ -302,7 +259,8 @@ void BondGraphicsView::showThumbnail() {
         thumbnailLabel->setPixmap(thumb.scaled(150, 150, Qt::KeepAspectRatio));
         thumbnailLabel->show();
         thumbnailVisible = true;
-    } else {
+    }
+    else {
         // 如果加载图片失败,显示"图片加载失败"
         thumbnailLabel->setText("图片加载失败");
         thumbnailLabel->setAlignment(Qt::AlignCenter);  // 居中显示文本
@@ -316,47 +274,13 @@ void BondGraphicsView::hideThumbnail() {
     thumbnailVisible = false;
     thumbnailLabel->move(0, 0);
 }
-void BondGraphicsView::checkAndCreateRegion()
-{
-    // 仅当两个点都有效时处理
-    if (topLeftIndex.first < 0 || bottomRightIndex.first < 0) return;
-
-    // 确定行列范围
-    int startRow = qMin(topLeftIndex.first, bottomRightIndex.first);
-    int endRow = qMax(topLeftIndex.first, bottomRightIndex.first);
-    int startCol = qMin(topLeftIndex.second, bottomRightIndex.second);
-    int endCol = qMax(topLeftIndex.second, bottomRightIndex.second);
-
-    // 遍历场景中的所有项
-    foreach (QGraphicsItem* item, scene()->items()) {
-        if (DieItem* die = dynamic_cast<DieItem*>(item)) {
-            int row = die->getRow();
-            int col = die->getCol();
-
-            // 判断是否在区域内
-            if (row >= startRow && row <= endRow &&
-                col >= startCol && col <= endCol) {
-
-                // 更新选中状态
-                die->setSelected(true);
-                selectedItemsMap.insert(qMakePair(row, col), die);
-            }
-        }
-    }
-
-    // 重置索引点
-    topLeftIndex = qMakePair(-1, -1);
-    bottomRightIndex = qMakePair(-1, -1);
-
-}
 
 void BondGraphicsView::clearRegion()
 {
-    // 清空选中的 DieItem
+    // 清空选中的 BondItem
     for (auto& item : selectedItemsMap) {
-        DieItem* die = dynamic_cast<DieItem*>(item);
-        if (die) {
-            die->setSelected(false); // 取消选中状态
+        if (BondItem* die = dynamic_cast<BondItem*>(item)) {
+            die->setSelected(false);
         }
     }
     selectedItemsMap.clear();
@@ -366,18 +290,6 @@ void BondGraphicsView::clearRegion()
     }
     selectedItem.clear();
 
-    if (topLeftItem && topLeftItem->scene()) {
-        topLeftItem->setRightSelected(false);
-    }
-    topLeftItem.clear();
-
-    if (bottomRightItem && bottomRightItem->scene()) {
-        bottomRightItem->setRightSelected(false);
-    }
-    bottomRightItem.clear();
-    topLeftIndex = qMakePair(-1, -1);
-    bottomRightIndex = qMakePair(-1, -1);
-
     // 清除缩略图
     hideThumbnail();
 
@@ -385,15 +297,14 @@ void BondGraphicsView::clearRegion()
 void BondGraphicsView::setRegion()
 {
     for (auto it = selectedItemsMap.begin(); it != selectedItemsMap.end(); ++it) {
-        QPair<int, int> key = it.key();  // 获取当前元素的 key
-        qDebug() << "Row:" << key.first << ", Col:" << key.second;
+        int key = it.key();  // 获取当前元素的 key
+        qDebug() << key;
     }
 
-    // 清空选中的 DieItem
+    // 清空选中的 BondItem
     for (auto& item : selectedItemsMap) {
-        DieItem* die = dynamic_cast<DieItem*>(item);
-        if (die) {
-            die->setSelected(false); // 取消选中状态
+        if (BondItem* die = dynamic_cast<BondItem*>(item)) {
+            die->setSelected(false);
         }
     }
     selectedItemsMap.clear();
@@ -402,16 +313,4 @@ void BondGraphicsView::setRegion()
         selectedItem->setLeftSelected(false);
     }
     selectedItem.clear();
-
-    if (topLeftItem && topLeftItem->scene()) {
-        topLeftItem->setRightSelected(false);
-    }
-    topLeftItem.clear();
-
-    if (bottomRightItem && bottomRightItem->scene()) {
-        bottomRightItem->setRightSelected(false);
-    }
-    bottomRightItem.clear();
-    topLeftIndex = qMakePair(-1, -1);
-    bottomRightIndex = qMakePair(-1, -1);
 }

+ 7 - 17
View/die-bonder-ui/CameraMaterialGroupWnd/MaterialWindow/BondGraphicsView.h

@@ -1,11 +1,10 @@
 #ifndef BONDGRAPHICSVIEW_H
 #define BONDGRAPHICSVIEW_H
+
 #include <QGraphicsView>
-#include <QGraphicsScene>
-#include <QGraphicsRectItem>
-#include <QMouseEvent>
-#include "DieItem.h"
+#include <QMap>
 #include <QLabel>
+#include <QGraphicsRectItem>
 #include <QPointer>
 #include <CBondMatrix.h>
 
@@ -26,17 +25,15 @@ private:
 
 class BondGraphicsView : public QGraphicsView {
     Q_OBJECT
-
 public:
     BondGraphicsView(QGraphicsScene* scene, QWidget* parent = nullptr);
 
-
 protected:
     void mousePressEvent(QMouseEvent* event) override;
     void mouseMoveEvent(QMouseEvent* event) override;
     void mouseReleaseEvent(QMouseEvent* event) override;
     void wheelEvent(QWheelEvent* event) override;
-    bool eventFilter(QObject *obj, QEvent *event) override;
+    bool eventFilter(QObject* obj, QEvent* event) override;
 
 private:
     bool selecting; // 是否正在框选
@@ -45,24 +42,17 @@ private:
     QGraphicsRectItem* selectionRect; // 框选矩形
     double scaleFactor; // 当前缩放比例
     bool isDragging = false;
-    QMap<QPair<int, int>, QGraphicsItem*> selectedItemsMap;
-    QLabel *thumbnailLabel; // 缩略图标签
+    QMap<int, QGraphicsItem*> selectedItemsMap;
+    QLabel* thumbnailLabel; // 缩略图标签
     bool thumbnailVisible; // 缩略图可见状态
 
-    QPair<int, int> topLeftIndex;
-    QPair<int, int> bottomRightIndex;
-    QPointer<DieItem> selectedItem;
-    QPointer<DieItem> topLeftItem;
-    QPointer<DieItem> bottomRightItem;
+    QPointer<BondItem> selectedItem;
 
     void showThumbnail();
     void hideThumbnail();
 
-    void checkAndCreateRegion();
     void clearRegion();
     void setRegion();
 };
 
-
-
 #endif // BONDGRAPHICSVIEW_H

+ 17 - 17
View/die-bonder-ui/OriginalWnd/MainAndSecondaryCamerasWnd.cpp

@@ -609,23 +609,23 @@ void MainAndSecondaryCamerasWnd::GetUpDataImageShowSignals4(const QPixmap& image
 
 void MainAndSecondaryCamerasWnd::wheelEvent(QWheelEvent *event)
 {
-    if (ui->viewwidgetgroup_L->getOperatewidget()->rect().contains(ui->viewwidgetgroup_L->getOperatewidget()->mapFromGlobal(event->globalPos()))) {
-       mousePos = ui->viewwidgetgroup_L->getOperatewidget()->mapFromGlobal(event->globalPos());
-       if (event->angleDelta().y() > 0) {
-           ui->viewwidgetgroup_L->updateScale(Left_scaleFactor * 1.1); // 放大
-       } else {
-           ui->viewwidgetgroup_L->updateScale(Left_scaleFactor * 0.9); // 缩小
-       }
-    }
-
-    if (ui->viewwidgetgroup_R->getOperatewidget()->rect().contains(ui->viewwidgetgroup_R->getOperatewidget()->mapFromGlobal(event->globalPos()))) {
-       mousePos = ui->viewwidgetgroup_R->getOperatewidget()->mapFromGlobal(event->globalPos());
-       if (event->angleDelta().y() > 0) {
-           ui->viewwidgetgroup_R->updateScale(Right_scaleFactor * 1.1); // 放大
-       } else {
-           ui->viewwidgetgroup_R->updateScale(Right_scaleFactor * 0.9); // 缩小
-       }
-    }
+    //if (ui->viewwidgetgroup_L->getOperatewidget()->rect().contains(ui->viewwidgetgroup_L->getOperatewidget()->mapFromGlobal(event->globalPos()))) {
+    //   mousePos = ui->viewwidgetgroup_L->getOperatewidget()->mapFromGlobal(event->globalPos());
+    //   if (event->angleDelta().y() > 0) {
+    //       ui->viewwidgetgroup_L->updateScale(Left_scaleFactor * 1.1); // 放大
+    //   } else {
+    //       ui->viewwidgetgroup_L->updateScale(Left_scaleFactor * 0.9); // 缩小
+    //   }
+    //}
+
+    //if (ui->viewwidgetgroup_R->getOperatewidget()->rect().contains(ui->viewwidgetgroup_R->getOperatewidget()->mapFromGlobal(event->globalPos()))) {
+    //   mousePos = ui->viewwidgetgroup_R->getOperatewidget()->mapFromGlobal(event->globalPos());
+    //   if (event->angleDelta().y() > 0) {
+    //       ui->viewwidgetgroup_R->updateScale(Right_scaleFactor * 1.1); // 放大
+    //   } else {
+    //       ui->viewwidgetgroup_R->updateScale(Right_scaleFactor * 0.9); // 缩小
+    //   }
+    //}
     if (ui->scrollArea->rect().contains(ui->scrollArea->mapFromGlobal(event->globalPos()))) {
         // 获取 QScrollArea 的横向滚动条
         QScrollBar *scrollBar = ui->scrollArea->horizontalScrollBar();

+ 1 - 1
View/die-bonder-ui/OriginalWnd/MainAndSecondaryCamerasWnd.h

@@ -150,7 +150,7 @@ private:
 
     QMap<int, Waffle*> waffleMap;
     QMap<int, MaterialBox*> materialBoxMap;
-    QMap<int, Bond*> bondMap;
+
 
     OperateMode         Left_currentMode = ModeImage;
 

+ 2 - 0
View/die-bonder-ui/SBTdie-bonder-ui.vcxproj

@@ -208,6 +208,7 @@
   </ItemDefinitionGroup>
   <ItemGroup>
     <ClCompile Include="CameraDistribute.cpp" />
+    <ClCompile Include="CameraMaterialGroupWnd\MaterialWindow\Bond.cpp" />
     <ClCompile Include="CameraMaterialGroupWnd\MaterialWindow\BondGraphicsView.cpp" />
     <ClCompile Include="CameraMaterialGroupWnd\MaterialWindow\DraggableLine.cpp" />
     <ClCompile Include="CameraMaterialGroupWnd\MaterialWindow\MaterialBoxGraphicsView.cpp" />
@@ -255,6 +256,7 @@
     <QtMoc Include="OriginalWnd\JOriginalMainWnd.h" />
     <ClInclude Include="CameraDistribute.h" />
     <QtMoc Include="CameraMaterialGroupWnd\MaterialWindow\BondGraphicsView.h" />
+    <QtMoc Include="CameraMaterialGroupWnd\MaterialWindow\Bond.h" />
     <ClInclude Include="CameraMaterialGroupWnd\MaterialWindow\DraggableLine.h" />
     <QtMoc Include="CameraMaterialGroupWnd\MaterialWindow\MaterialBoxGraphicsView.h" />
     <ClInclude Include="JUserAccountsData.h" />

+ 9 - 3
View/die-bonder-ui/SBTdie-bonder-ui.vcxproj.filters

@@ -246,6 +246,9 @@
     <ClCompile Include="Src\common\GlobalUse\JMouseMonitorThread.cpp">
       <Filter>Source Files\Src\common\GlobalUse</Filter>
     </ClCompile>
+    <ClCompile Include="CameraMaterialGroupWnd\MaterialWindow\Bond.cpp">
+      <Filter>Source Files\CameraMaterialGroupWnd\MaterialWindow</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <QtMoc Include="ImageWidget.h">
@@ -311,9 +314,6 @@
     <ClInclude Include="CameraMaterialGroupWnd\MaterialWindow\Waffle.h">
       <Filter>Header Files\CameraMaterialGroupWnd\MaterialWindow</Filter>
     </ClInclude>
-    <QtMoc Include="CameraMaterialGroupWnd\MaterialWindow\BondGraphicsView.h">
-      <Filter>Header Files\CameraMaterialGroupWnd\MaterialWindow</Filter>
-    </QtMoc>
     <QtMoc Include="CameraMaterialGroupWnd\MaterialWindow\MaterialBoxGraphicsView.h">
       <Filter>Header Files\CameraMaterialGroupWnd\MaterialWindow</Filter>
     </QtMoc>
@@ -329,6 +329,12 @@
     <QtMoc Include="Src\common\GlobalUse\JMouseMonitorThread.h">
       <Filter>Source Files\Src\common\GlobalUse</Filter>
     </QtMoc>
+    <QtMoc Include="CameraMaterialGroupWnd\MaterialWindow\Bond.h">
+      <Filter>Header Files\CameraMaterialGroupWnd\MaterialWindow</Filter>
+    </QtMoc>
+    <QtMoc Include="CameraMaterialGroupWnd\MaterialWindow\BondGraphicsView.h">
+      <Filter>Header Files\CameraMaterialGroupWnd\MaterialWindow</Filter>
+    </QtMoc>
   </ItemGroup>
   <ItemGroup>
     <CustomBuild Include="debug\moc_predefs.h.cbt">

+ 26 - 3
View/die-bonder-ui/Src/RewriteControl/ControlOperationPage.cpp

@@ -177,6 +177,16 @@ void ControlOperationPage::KindsofWidget(kinds kind)
         }
         
     }
+    else if (kind == bond_kind)
+    {
+        if (m_bond)
+        {
+            isRun = true;
+            m_bond->initFrom(ui->Operatewidget);
+            layout->addWidget(m_bond->view);
+            m_currentView = m_bond->view;
+        }
+    }
 
     if (isRun)
     {
@@ -201,9 +211,10 @@ void ControlOperationPage::setMaterialBox(MaterialBox* materialbox) {
     m_materialbox = materialbox;
     updateMaterialWidget(materialbox_kind);
 }
-//void ControlOperationPage::setBond(Bond *bond){
-//    m_bond = bond;
-//}
+void ControlOperationPage::setBond(Bond *bond){
+    m_bond = bond;
+    updateMaterialWidget(bond_kind);
+}
 
 void ControlOperationPage::initForm()
 {
@@ -330,6 +341,18 @@ bool ControlOperationPage::eventFilter(QObject* obj, QEvent* event)
     return QWidget::eventFilter(obj, event);
 }
 
+void ControlOperationPage::wheelEvent(QWheelEvent* event) {
+    if (ui->Operatewidget->rect().contains(ui->Operatewidget->mapFromGlobal(event->globalPos()))) {
+        QPoint              mousePos;
+        mousePos = ui->Operatewidget->mapFromGlobal(event->globalPos());
+        if (event->angleDelta().y() > 0) {
+            updateScale(m_scaleFactor * 1.1); // 放大
+        }
+        else {
+            updateScale(m_scaleFactor * 0.9); // 缩小
+        }
+    }
+}
 void ControlOperationPage::HideLayout(bool bShow)
 {
     for (int i = 0; i < ui->horizontalLayout->count(); ++i)

+ 4 - 2
View/die-bonder-ui/Src/RewriteControl/ControlOperationPage.h

@@ -7,6 +7,7 @@
 #include "CameraMaterialGroupWnd/MaterialWindow/Wafer.h"
 #include "CameraMaterialGroupWnd/MaterialWindow/Waffle.h"
 #include "CameraMaterialGroupWnd/MaterialWindow/MaterialBox.h"
+#include "CameraMaterialGroupWnd/MaterialWindow/Bond.h"
 #include "OriginalWnd/CameraDataHandleAndShow.h"
 #include "CameraMaterialGroupWnd/CameraImage/CameraImageHandler.h"
 #include "ImageWidget.h"
@@ -41,7 +42,7 @@ public:
     void setWafer(Wafer *wafer);
     void setWaffle(Waffle *waffle);
     void setMaterialBox(MaterialBox *materialbox);
-    //void setBond(Bond *bond);
+    void setBond(Bond *bond);
     ImageWidget* getOperatewidget();
     void resizeSingleUI(bool bMax = false);
     void resizeChartsAndCamerasUI();
@@ -73,6 +74,7 @@ protected:
     void mousePressEvent(QMouseEvent* event) override;
 
     void mouseMoveEvent(QMouseEvent* event) override;
+    void wheelEvent(QWheelEvent* event) override;
 
     bool eventFilter(QObject* obj, QEvent* event) override;
 
@@ -105,7 +107,7 @@ private:
     Wafer*                      m_wafer                 = nullptr; // 声明Wafer指针
     Waffle*                     m_waffle                = nullptr; // 声明Waffle指针
     MaterialBox*                m_materialbox           = nullptr; // 声明materialbox指针
-    //Bond *m_bond;
+    Bond*                       m_bond                  = nullptr;
 
 
     /**用作定时使用,后面移动到整个类里面,目前先实现功能