浏览代码

相机和图片切换以及物料切换

yun 3 周之前
父节点
当前提交
f2bcf007f6

二进制
Output/bin/x64/SBT_zh_CN.qm


二进制
Output/bin/x64/configurations.db


+ 42 - 159
View/die-bonder-ui/CameraMaterialGroupWnd/CameraImage/CameraImageHandler.cpp

@@ -1,58 +1,22 @@
 #include "CameraImageHandler.h"
 #include "CameraMaterialGroupWnd/Group.h"
-
-CameraImageHandler::CameraImageHandler(int iCameraId) 
+#include <QDirIterator>
+CameraImageHandler::CameraImageHandler(const int groupId,const CameraInfo& cameraInfo)
 {
-    captureAndConvertImage(iCameraId);
+    captureAndConvertImage(groupId,cameraInfo);
 }
 
-void CameraImageHandler::captureAndConvertImage(int iCameraId) {
-
-    // CInterface interface;
-    // ImageInfo image;
+void CameraImageHandler::captureAndConvertImage(const int groupId,const CameraInfo& cameraInfo) {
 
-    // long result = interface.GrabImage(iCameraId, image);
 
-    // if (result == 0) {
-    //     initGroup(iCameraId);
-    // }
     m_pCViewInterface = ns_module::CViewInterface::GetInstance();
     if (m_pCViewInterface == nullptr);
     {
         // 目前不做处理,为了兼容    
     }
 
-    initGroup(iCameraId);
+    CreateGroupData(groupId,cameraInfo);
     
-    // if (result == 0) {
-    //     qDebug() << "Image width: " << image.width;
-    //     qDebug() << "Image height: " << image.height;
-
-    //     QImage img;
-
-    //     // 根据图像格式转换
-    //     switch (image.format) {
-    //     case GRAY8:
-    //         img = QImage(image.data, image.width, image.height, QImage::Format_Grayscale8);
-    //         break;
-    //     case RGB888:
-    //         img = QImage(image.data, image.width, image.height, QImage::Format_RGB888);
-    //         break;
-    //     case ARGB8888:
-    //         img = QImage(image.data, image.width, image.height, QImage::Format_ARGB32);
-    //         break;
-    //     case RGB32:
-    //         img = QImage(image.data, image.width, image.height, QImage::Format_RGB32);
-    //         break;
-    //     case YUV422:
-
-    //         break;
-    //     default:
-    //         qDebug() << "Unsupported image format";
-    //     }
-    // } else {
-    //     qDebug() << "Failed to grab image, error code: " << result;
-    // }
 
 }
 
@@ -77,125 +41,13 @@ Bond* CameraImageHandler::getBond() const {
     return m_pBond;
 }
 
-void CameraImageHandler::initGroup(int CameraId) 
-{
-    /** 这里面为什么又在Group 里面创建一个呢? ,不能同步?
-     */
-    //CreateGroupData();
-
-
-
-
-   /* int CameraId, QString path, enum MaterialWindowType materialWindowType*/
-    QStringList dispmodel1;
-    dispmodel1 << "P die align" << "D device align";
-
-    QStringList dispmodel2;
-    dispmodel2 << "D device align" << "P die align";
-
-    QStringList dispmodel3;
-    dispmodel3 << "B device align" << "P die align";
+QList<QPair<QString, QString>> CameraImageHandler::getFileList(){
+    return m_pfileList;
+}
 
-    QStringList dispmodel4;
-    dispmodel4 << "U die align" << "D device align";
 
-    if (CameraId == 1)
-    {
-        MaterialWindowType = 4;
 
-        m_pBond = new Bond(0);
-        if (m_pCViewInterface != nullptr)
-        {
-            std::vector<ns_mat::POINT_INFO_STRUCT> stPointInfo;
-            m_pCViewInterface->GetBondAllPointInfo(stPointInfo);
-            m_pBond->UpdataVal(stPointInfo);
-        }
-        else
-        {
-            m_pBond->UpdataGenerateTestData();
-        }
-
-        m_pGroup = new Group(CameraId, ":/images/test_image/image_1.png", MaterialWindowType, dispmodel1, this);
-    } 
-    else if (CameraId == 2) 
-    {
-        MaterialWindowType = 2;
-        m_pWaffle = new Waffle(0);
-        if (m_pCViewInterface != nullptr)
-        {
-            std::vector<ns_mat::WAFFLE_MATRIX_POINT_STRUCT> veWaffle;
-            //m_pCViewInterface->GetWafflePackAllPointInfo(veWaffle);
-            m_pWaffle->UpdataVal(veWaffle);
-        }
-        else
-        {
-            m_pWaffle->UpdataGenerateTestData();
-        }
-        m_pGroup = new Group(CameraId, ":/images/test_image/image_3.png", MaterialWindowType, dispmodel2, this);
-    } 
-    else if (CameraId == 3) 
-    {
-        MaterialWindowType = 3;
-        m_pMaterialBox = new MaterialBox(0);
-        m_pGroup = new Group(CameraId, ":/images/test_image/image_5.png", MaterialWindowType, dispmodel3, this);
-    } 
-    else if (CameraId == 4) 
-    {
-       MaterialWindowType = 1;
-       m_pWafer = new Wafer(0);
-       if (m_pCViewInterface != nullptr)
-       {
-           std::vector<ns_mat::WAFER_MATRIX_POINT_INFO_STRUCT> veWafer;
-           m_pCViewInterface->GetWaferAllPointInfo(veWafer);
-           m_pWafer->UpdataVal(veWafer);
-       }
-       else
-       {
-           m_pWafer->UpdataGenerateTestData();
-       }
-        m_pGroup = new Group(CameraId, ":/images/test_image/image_7.png", MaterialWindowType, dispmodel4, this);
-    } 
-    else if (CameraId == 5) 
-    {
-        MaterialWindowType = 1;
-        m_pWafer = new Wafer(0);
-        if (m_pCViewInterface != nullptr)
-        {
-            std::vector<ns_mat::WAFER_MATRIX_POINT_INFO_STRUCT> veWafer;
-            m_pCViewInterface->GetWaferAllPointInfo(veWafer);
-            m_pWafer->UpdataVal(veWafer);
-        }
-        else
-        {
-            m_pWafer->UpdataGenerateTestData();
-        }
-        m_pGroup = new Group(CameraId, ":/images/test_image/image_1.png", MaterialWindowType, dispmodel1, this);
-    } 
-    else if (CameraId == 6) 
-    {
-        MaterialWindowType = 2;
-        m_pWaffle = new Waffle(0);
-        m_pGroup = new Group(CameraId, ":/images/test_image/image_3.png", MaterialWindowType, dispmodel2, this);
-    } 
-    else if (CameraId == 7)
-    {
-        MaterialWindowType = 3;
-		m_pMaterialBox = new MaterialBox(0);
-        m_pGroup = new Group(CameraId, ":/images/test_image/image_5.png", MaterialWindowType, dispmodel3, this);
-    } 
-    else if (CameraId == 8)
-    {
-        MaterialWindowType = 1;
-        m_pWafer = new Wafer(0);
-        m_pGroup = new Group(CameraId, ":/images/test_image/image_7.png", MaterialWindowType, dispmodel4, this);
-    } 
-    else 
-    {
-        m_pGroup = nullptr; // 如果 CameraId 不匹配,则 group 为 nullptr
-    }
-}
-
-void CameraImageHandler::CreateGroupData(const CameraInfo& cameraInfo)
+void CameraImageHandler::CreateGroupData(const int groupId,const CameraInfo& cameraInfo)
 {
     QString strPatch = R"(D:\config\MaterialInfo\)"; // 真实的路径 
     switch (cameraInfo.iCameraId)
@@ -228,8 +80,11 @@ void CameraImageHandler::CreateGroupData(const CameraInfo& cameraInfo)
        default:
            break;
     }
-
-    //m_pGroup = new Group(cameraInfo, strPatch, this);
+    //初始化group
+    //测试路径
+    strPatch = "D:/code/JSBTDieBondH/View/die-bonder-ui/images/test_image";
+    m_pfileList = loadImages(cameraInfo, strPatch);
+    m_pGroup = new Group(groupId,cameraInfo, m_pCViewInterface,m_pfileList, this);
 }
 
 QString CameraImageHandler::CreateMaterialType(MATERIAL_TYPE materialType)
@@ -303,3 +158,31 @@ QString CameraImageHandler::CreateMaterialType(MATERIAL_TYPE materialType)
 
     return strLoadPatch;
 }
+
+
+QList<QPair<QString, QString>> CameraImageHandler::loadImages(const CameraInfo& cameraInfo,const QString &dirPath)
+{
+    QDir directory(dirPath);
+    if (!directory.exists()) {
+        qWarning() << "Directory does not exist:" << dirPath;
+    }
+
+    // 支持的图片格式过滤器
+    QStringList filters;
+    filters << "*.png" << "*.jpg" << "*.jpeg" << "*.bmp" << "*.gif";
+
+    // 递归遍历所有子目录,忽略大小写
+    QDirIterator it(dirPath, filters, QDir::Files | QDir::NoDotAndDotDot,
+                    QDirIterator::Subdirectories);
+
+    QList<QPair<QString, QString>> fileList;
+
+    fileList.append(qMakePair(QString::fromStdString(cameraInfo.name), QString("1")));
+    while (it.hasNext()) {
+        QString filePath = it.next();
+        QFileInfo fileInfo(filePath);
+        // 添加文件名和完整路径到列表
+        fileList.append(qMakePair(fileInfo.fileName(), filePath));
+    }
+    return fileList;
+}

+ 7 - 3
View/die-bonder-ui/CameraMaterialGroupWnd/CameraImage/CameraImageHandler.h

@@ -19,22 +19,24 @@
 class CameraImageHandler : public QWidget {
     Q_OBJECT
 public:
-    CameraImageHandler(int iCameraId);
+    CameraImageHandler(const int groupId,const CameraInfo& cameraInfo);
 
     Group* getGroup() const;
     Wafer* getWafer() const;
     Waffle* getWaffle() const;
     MaterialBox* getMaterialBox() const;
     Bond* getBond() const;
+    QList<QPair<QString, QString>> getFileList();
+    QList<QPair<QString, QString>> loadImages(const CameraInfo& cameraInfo,const QString &dirPath);
 
 private:
-    void captureAndConvertImage(int CameraId);
+    void captureAndConvertImage(const int groupId, const CameraInfo& cameraInfo);
 
     void initGroup(int CameraId);
 
     /**分组
      */
-    void CreateGroupData(const CameraInfo& cameraInfo);
+    void CreateGroupData(const int groupId,const CameraInfo& cameraInfo);
 
     /**创建物料类型
      */
@@ -62,6 +64,8 @@ private:
     /**接口指针
      */
     ns_module::CViewInterface* m_pCViewInterface;
+
+    QList<QPair<QString, QString>> m_pfileList;
 };
 
 #endif // CAMERAIMAGEHANDLER_H

+ 107 - 57
View/die-bonder-ui/CameraMaterialGroupWnd/Group.cpp

@@ -14,20 +14,19 @@ Group* Group::m_pLastClickedGroup = nullptr;
 int Group::m_stnLastClickedIndex = 0;
 int Group::m_stnLastSavedIndex = 1;
 
-// 没看懂,为啥要这么传
-Group::Group(int Id, const QString& imagePath1, int MaterialWindowType, const QStringList& textList, QWidget* parent)
+Group::Group(int groupId,const CameraInfo& cameraInfo, ns_module::CViewInterface *cViewInterface,QList<QPair<QString, QString>> fileList,QWidget* parent)
 //Group::Group(const CameraInfo& cameraInfo, QWidget* parent)
-    : QWidget(parent), ui(new Ui::Group), m_nGroupId(Id)
+    : QWidget(parent), ui(new Ui::Group), m_nCurrentGroupId(groupId)
 {
     ui->setupUi(this);
-
-    QPixmap pixmap1(imagePath1);
-    ui->Imagewidget_left->setPixmap(pixmap1);
-
-
+    m_stnCurrentComboBoxIndex = 0;
+    m_pCViewInterface = cViewInterface;
+    m_nGroupId = m_nCurrentGroupId;
     //初始化目录名称
-    //ui->DatacomboBox->addItems(getFileNames(strPatch));
-    ui->DatacomboBox->addItems(textList);
+    for (const auto& pair : fileList) {
+        ui->DatacomboBox->addItem(pair.first, pair.second);
+    }
+    ui->DatacomboBox->setCurrentIndex(m_stnCurrentComboBoxIndex);
     ui->GroupButton->setStyleSheet(
         "QPushButton:hover {"
         "   background-color: #45a049;"
@@ -37,34 +36,69 @@ Group::Group(int Id, const QString& imagePath1, int MaterialWindowType, const QS
         "}"
         );
 
-    ui->Imagewidget_left->setProperty("groupId", Id);
-    ui->Imagewidget_right->setProperty("groupId", Id);
+    ui->Imagewidget_left->setProperty("groupId", groupId);
+    ui->Imagewidget_right->setProperty("groupId", groupId);
+
+    ui->rightBackground->setStyleSheet("");
+    ui->leftBackground->setStyleSheet("");
+
 
-    if (MaterialWindowType == 1) 
+    if (cameraInfo.eType == 1) 
     {
         m_pWafer = new Wafer(0, ui->Imagewidget_right);
+        if (m_pCViewInterface != nullptr)
+        {
+            std::vector<ns_mat::WAFER_MATRIX_POINT_INFO_STRUCT> veWafer;
+            m_pCViewInterface->GetWaferAllPointInfo(veWafer);
+            m_pWafer->UpdataVal(veWafer);
+        }
+        else
+        {
+            m_pWafer->UpdataGenerateTestData();
+        }
         WaferWidget();
     } 
-    else if (MaterialWindowType == 2) 
+    else if (cameraInfo.eType == 2) 
     {
         m_pWaffle = new Waffle(0, ui->Imagewidget_right);
+        if (m_pCViewInterface != nullptr)
+        {
+            std::vector<ns_mat::WAFFLE_MATRIX_POINT_STRUCT> veWaffle;
+            m_pCViewInterface->GetWafflePackAllPointInfo(veWaffle);
+            m_pWaffle->UpdataVal(veWaffle);
+        }
+        else
+        {
+            m_pWaffle->UpdataGenerateTestData();
+        }
         WaffleWidget();
     }
-    else if (MaterialWindowType == 3) 
+    else if (cameraInfo.eType == 3) 
     {
         m_pMaterialbox = new MaterialBox(0, ui->Imagewidget_right);
         MaterialBoxWidget();
     }
-    else if (MaterialWindowType == 4)
+    else if (cameraInfo.eType == 4)
     {
         m_pBond = new Bond(ui->Imagewidget_right);
+        if (m_pCViewInterface != nullptr)
+        {
+            std::vector<ns_mat::POINT_INFO_STRUCT> stPointInfo;
+            m_pCViewInterface->GetBondAllPointInfo(stPointInfo);
+            m_pBond->UpdataVal(stPointInfo);
+        }
+        else
+        {
+            m_pBond->UpdataGenerateTestData();
+        }
         BondWidget();
     }
 
-    // 没看懂,列表保存干啥?
-    //saveGroupSettings(Id, imagePath1, MaterialWindowType, strPatch);
-    saveGroupSettings(Id, imagePath1, MaterialWindowType, textList);
+
+    saveGroupSettings(groupId, cameraInfo.eType);
     connect(ui->GroupButton, &QPushButton::clicked, this, &Group::onclickbutton);
+    connect(ui->DatacomboBox, QOverload<int>::of(&QComboBox::currentIndexChanged),
+        this, &Group::on_DatacomboBox_currentIndexChanged);
     initForm();
 
     connect(this, &Group::SendGroupSelectedSignals, this, &Group::GetGroupSelectedSlots);
@@ -161,13 +195,13 @@ void Group::check_selected(int index)
     }
 }
 
-void Group::saveGroupSettings(int Id, const QString& imagePath1, int materialWndType, const QStringList& textList)
+void Group::saveGroupSettings(int Id, int materialWndType)
 {
     QSettings settings("YourOrganization", "YourApplication");
     settings.beginGroup(QString::number(Id));
-    settings.setValue("ImagePath1", imagePath1);
+    //settings.setValue("ImagePath1", imagePath1);
     settings.setValue("MaterialWndType", materialWndType);
-    settings.setValue("TextList", textList);
+    //settings.setValue("TextList", textList);
     settings.endGroup();
 }
 
@@ -227,32 +261,10 @@ void Group::BondWidget()
     layout2->addWidget(pixmapLabel);
 }
 
-QStringList Group::getFileNames(const QString& dirPath)
-{
-    QStringList fileNames;
-    QDir dir(dirPath);
-
-    // 检查目录是否存在
-    if (!dir.exists())
-    {
-        return fileNames;
-    }
-
-    // 列出目录中的所有文件
-    dir.setFilter(QDir::Files); 
-    QFileInfoList fileInfoList = dir.entryInfoList();
-
-    for (const QFileInfo& fileInfo : fileInfoList) 
-    {
-        fileNames << fileInfo.fileName();
-    }
-
-    return fileNames;
-}
 
 void Group::onclickbutton(){
     QSettings settings("YourCompany", "YourApplication_Button");
-    settings.setValue("GroupId_button", m_nGroupId);
+    settings.setValue("GroupId_button", m_nCurrentGroupId);
 
     emit send_button_Signal();
 }
@@ -261,8 +273,9 @@ void Group::setDatacomboBox(int index){
     ui->DatacomboBox->setCurrentIndex(index);
 }
 
-void Group::on_DatacomboBox_currentIndexChanged(int index){
-    send_ComboBox_singal(m_nCurrentGroupId,index);
+void Group::on_DatacomboBox_currentIndexChanged(int comboxIndex){
+
+    send_ComboBox_singal(m_nCurrentGroupId,comboxIndex);
 }
 
 
@@ -289,7 +302,7 @@ void Group::hideEvent(QHideEvent *event) {
 void Group::saveBorderSettings()
 {
     QSettings settings("YourOrganization", "YourApplication");
-    settings.beginGroup(QString::number(m_nGroupId));
+    settings.beginGroup(QString::number(m_nCurrentGroupId));
 
     QString leftStyle = ui->leftBackground->styleSheet();
     QString rightStyle = ui->rightBackground->styleSheet();
@@ -297,13 +310,13 @@ void Group::saveBorderSettings()
     if (leftStyle.contains("blue", Qt::CaseInsensitive)) {
         leftStyle = ""; // 清除样式
         // 记录该边框信息
-        recordBorderInfo(m_nGroupId, "Left");
+        recordBorderInfo(m_nCurrentGroupId, "Left");
     }
 
     if (rightStyle.contains("blue", Qt::CaseInsensitive)) {
         rightStyle = ""; // 清除样式
         // 记录该边框信息
-        recordBorderInfo(m_nGroupId, "Right");
+        recordBorderInfo(m_nCurrentGroupId, "Right");
     }
 
 
@@ -336,7 +349,7 @@ void Group::loadBorderSettings()
 {
   
     QSettings settings("YourOrganization", "YourApplication");
-    settings.beginGroup(QString::number(m_nGroupId));
+    settings.beginGroup(QString::number(m_nCurrentGroupId));
 
     QString leftStyle = settings.value("LeftBorderStyle", "").toString();
     QString rightStyle = settings.value("RightBorderStyle", "").toString();
@@ -350,14 +363,14 @@ void Group::loadBorderSettings()
     if (Index == 2) {
         QSettings borderInfoSettings("YourOrganization", "YourApplication");
         borderInfoSettings.beginGroup("ModifiedBorders");
-        QString leftKey = QString("%1_Left").arg(m_nGroupId);
-        QString rightKey = QString("%1_Right").arg(m_nGroupId);
+        QString leftKey = QString("%1_Left").arg(m_nCurrentGroupId);
+        QString rightKey = QString("%1_Right").arg(m_nCurrentGroupId);
 
         // 检查左边框是否需要还原
         if (borderInfoSettings.contains(leftKey)) {
             leftStyle = getBlueBorderStyle();
             borderInfoSettings.remove(leftKey); // 移除记录,避免下次重复处理
-            qDebug() << "Left border of group" << m_nGroupId << "restored to blue.";
+            qDebug() << "Left border of group" << m_nCurrentGroupId << "restored to blue.";
             m_pPreviouslySelectedBlueGroup = this;
             // lastClickedGroup =this;
         }
@@ -365,7 +378,7 @@ void Group::loadBorderSettings()
         if (borderInfoSettings.contains(rightKey)) {
             rightStyle = getBlueBorderStyle();
             borderInfoSettings.remove(rightKey);
-            qDebug() << "Right border of group" << m_nGroupId << "restored to blue.";
+            qDebug() << "Right border of group" << m_nCurrentGroupId << "restored to blue.";
             m_pPreviouslySelectedBlueGroup = this;
             // lastClickedGroup =this;
         }
@@ -380,11 +393,11 @@ void Group::loadBorderSettings()
         m_pLastClickedGroup = this;
         if (leftStyle.contains("red")) {
             m_stnLastClickedIndex = 1;
-            qDebug() << "Left border of group" << m_nGroupId << "is red.";
+            qDebug() << "Left border of group" << m_nCurrentGroupId << "is red.";
         }
         else if (rightStyle.contains("red")) {
             m_stnLastClickedIndex = 2;
-            qDebug() << "Right border of group" << m_nGroupId << "is red.";
+            qDebug() << "Right border of group" << m_nCurrentGroupId << "is red.";
         }
     }
 
@@ -483,3 +496,40 @@ void Group::setEnableControls(bool enable) {
         ui->GroupButton->setStyleSheet("background-color: lightgray;");
     }
 }
+
+int Group::getCurrentComboBoxIndex(){
+    return ui->DatacomboBox->currentIndex();
+}
+
+void Group::setCurrentCombox(const int index){
+    m_stnCurrentComboBoxIndex = index;
+    if(m_stnCurrentComboBoxIndex != 0){
+
+        QString imagePath = ui->DatacomboBox->itemData(index).toString();
+        QPixmap pixmap(imagePath);
+        QSize size_left = ui->Imagewidget_left->size();
+        QPixmap scaledPixmap = pixmap.scaled(size_left, Qt::KeepAspectRatio, Qt::SmoothTransformation);
+        ui->Imagewidget_left->setPixmap(scaledPixmap);
+    }
+
+}
+
+void Group::initBorderStyle(int index,int color) {
+    if (index == 2) {
+        if(color == 0){
+            ui->rightBackground->setStyleSheet("border: 2px solid blue;");
+        }
+        else {
+            ui->rightBackground->setStyleSheet("border: 2px solid red;");
+        }
+ 
+    }
+    else {
+        if (color == 0) {
+            ui->leftBackground->setStyleSheet("border: 2px solid blue;");
+        }
+        else {
+            ui->leftBackground->setStyleSheet("border: 2px solid red;");
+        }
+    }
+}

+ 10 - 7
View/die-bonder-ui/CameraMaterialGroupWnd/Group.h

@@ -7,6 +7,7 @@
 #include "CameraMaterialGroupWnd/MaterialWindow/Waffle.h"
 #include "CameraMaterialGroupWnd/MaterialWindow/MaterialBox.h"
 #include "CameraMaterialGroupWnd/MaterialWindow/Bond.h"
+#include <CViewInterface.h>
 
 namespace Ui {
 class Group;
@@ -17,15 +18,13 @@ class Group : public QWidget
     Q_OBJECT
 
 public:
-    // 需要修改
-    //explicit Group(const CameraInfo& cameraInfo, QWidget* parent);
-    explicit Group(int Id, const QString& imagePath1, int MaterialWindowType, const QStringList& textList, QWidget* parent);
-
+    // 相机ID 实时图片 物料窗口类型 下拉框文本
+    explicit Group(int groupId,const CameraInfo& cameraInfo, ns_module::CViewInterface *cViewInterface,QList<QPair<QString, QString>> fileList,QWidget* parent);
     ~Group();
 
     void initForm();
     bool eventFilter(QObject *obj, QEvent *event);
-    void saveGroupSettings(int Id, const QString& imagePath1, int materialWndType, const QStringList& textList);
+    void saveGroupSettings(int Id, int materialWndType);
     void saveBorderSettings();  // 新增:保存边框颜色信息
     void loadBorderSettings();  // 新增:加载边框颜色信息
     void recordBorderInfo(int groupId, const QString& side);
@@ -33,6 +32,9 @@ public:
     QString getRedBorderStyle();
     void setDatacomboBox(int index);
     void setEnableControls(bool enable);
+    int getCurrentComboBoxIndex();
+    void setCurrentCombox(const int index);
+    void initBorderStyle(int index,int color);
 
 signals:
     void send_button_Signal();
@@ -50,7 +52,7 @@ signals:
 public slots:
     void Changedstyle();
     void onclickbutton();
-    void on_DatacomboBox_currentIndexChanged(int index);
+    void on_DatacomboBox_currentIndexChanged(int comboxIndex);
     void GetGroupSelectedSlots(Group* group, int index);
 
 
@@ -65,7 +67,6 @@ protected:
     void MaterialBoxWidget(); // 料盒
     void BondWidget();
 
-    QStringList getFileNames(const QString& dirPath);
 private:
     Ui::Group *ui;
 
@@ -79,9 +80,11 @@ private:
     static Group*   m_pLastClickedGroup; // 上一次点击的实例
     static int      m_stnLastClickedIndex; // 上一次点击的索引
     static int      m_stnLastSavedIndex; // 上次保存的索引
+    int      m_stnCurrentComboBoxIndex;
 
 public:
     int             m_nGroupId;  // 新增:记录当前 Group 的 ID
+    ns_module::CViewInterface* m_pCViewInterface;
 };
 
 #endif // GROUP_H

+ 7 - 0
View/die-bonder-ui/CameraMaterialGroupWnd/MaterialWindow/Wafer.cpp

@@ -67,6 +67,13 @@ void Wafer::UpdataVal(const std::vector<ns_mat::WAFER_MATRIX_POINT_INFO_STRUCT>&
     {
         waferData.append(a);
     }
+
+    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) {

+ 5 - 5
View/die-bonder-ui/CameraMaterialGroupWnd/MaterialWindow/WaferGraphicsView.cpp

@@ -185,7 +185,7 @@ void WaferGraphicsView::mouseReleaseEvent(QMouseEvent* event) {
                 }
                 });
             if (die) {
-                menu.addAction("移动到该位置", [this, die] {
+                menu.addAction(tr("move to current location","移动到该位置"), [this, die] {
                     for (auto& item : selectedItemsMap) {
                         DieItem* die = dynamic_cast<DieItem*>(item);
                         if (die) {
@@ -216,7 +216,7 @@ void WaferGraphicsView::mouseReleaseEvent(QMouseEvent* event) {
                     });
 
                 // 设置区域边界点菜单
-                menu.addAction("设为左上点", [this, die] {
+                menu.addAction(tr("set Top left point","设为左上点"), [this, die] {
                     if (topLeftItem && topLeftItem->scene()) {
                         topLeftItem->setRightSelected(false);
                     }
@@ -227,7 +227,7 @@ void WaferGraphicsView::mouseReleaseEvent(QMouseEvent* event) {
                     if (bottomRightIndex.first >= 0) checkAndCreateRegion();
                     });
 
-                menu.addAction("设为右下点", [this, die] {
+                menu.addAction(tr("set bottom right point","设为右下点"), [this, die] {
                     if (bottomRightItem && bottomRightItem->scene()) {
                         bottomRightItem->setRightSelected(false);
                     }
@@ -239,8 +239,8 @@ void WaferGraphicsView::mouseReleaseEvent(QMouseEvent* event) {
                     });
             }
 
-            menu.addAction("清除选中区域", [this] { clearRegion(); });
-            menu.addAction("设置区域", [this] { setRegion(); });
+            menu.addAction(tr("clear the selected area","清除选中区域"), [this] { clearRegion(); });
+            menu.addAction(tr("set area","设置区域"), [this] { setRegion(); });
 
             menu.exec(event->globalPos());
         }

+ 37 - 40
View/die-bonder-ui/ImageView.cpp

@@ -31,7 +31,7 @@ ImageView::ImageView(QWidget* parent) :
     setTransformationAnchor(QGraphicsView::AnchorUnderMouse);
     this->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
     this->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
-    //设置视图属性
+    //锟斤拷锟斤拷锟斤拷图锟斤拷锟斤拷
     //setRenderHint(QPainter::SmoothPixmapTransform);
     setRenderHint(QPainter::Antialiasing);
     setMouseTracking(true);
@@ -53,9 +53,9 @@ void ImageView::setPixmap(const QPixmap& newPixmap) {
     scene()->setSceneRect(sceneRect);
     setSceneRect(scene()->itemsBoundingRect());
     this->resize(m_pixmap.width(), m_pixmap.height());
-    m_imageOffset = QPoint(0, 0); // 重置图片偏移量为(0, 0)
+    m_imageOffset = QPoint(0, 0); // 锟斤拷锟斤拷图片偏锟斤拷锟斤拷为(0, 0)
     setCursor(Qt::ArrowCursor);
-    update(); // 触发重绘
+    update(); // 锟斤拷锟斤拷锟截伙拷
 }
 
 void ImageView::setCurPixmap(const QPixmap& newPixmap) {
@@ -70,9 +70,9 @@ void ImageView::setCurPixmap(const QPixmap& newPixmap) {
         scene()->setSceneRect(sceneRect);
         setSceneRect(scene()->itemsBoundingRect());
         //this->resize(m_pixmap.width(), m_pixmap.height());
-        m_imageOffset = QPoint(0, 0); // 重置图片偏移量为(0, 0)
+        m_imageOffset = QPoint(0, 0); // 锟斤拷锟斤拷图片偏锟斤拷锟斤拷为(0, 0)
         setCursor(Qt::ArrowCursor);
-        update(); // 触发重绘
+        update(); // 锟斤拷锟斤拷锟截伙拷
     }
     else {
         this->m_pixmap = newPixmap;
@@ -100,7 +100,7 @@ void ImageView::paintEvent(QPaintEvent* event) {
 
 void ImageView::mousePressEvent(QMouseEvent* event) {
     if (event->button() == Qt::LeftButton) {
-        // 当光标底下没有 item 时,才能移动
+        // 锟斤拷锟斤拷锟斤拷锟斤拷没锟斤拷 item 时锟斤拷锟斤拷锟斤拷锟狡讹拷
         QPointF point = mapToScene(event->pos());
         if (scene()->itemAt(point, transform()) != nullptr
             && scene()->itemAt(point, transform())->type() == QGraphicsPixmapItem::Type) {
@@ -115,7 +115,7 @@ void ImageView::mousePressEvent(QMouseEvent* event) {
 
         if (m_bRulerState) {
             if (!m_isCreating) {
-                // 第一次点击:开始创建
+                // 锟斤拷一锟轿碉拷锟斤拷锟斤拷锟绞硷拷锟斤拷锟�
                 m_isCreating = true;
                 m_startPos = mapToScene(event->pos());
                 m_pTempLine = scene()->addLine(QLineF(m_startPos, m_startPos),
@@ -123,7 +123,7 @@ void ImageView::mousePressEvent(QMouseEvent* event) {
                 m_pTempLine->setZValue(2);
             }
             else {
-                // 第二次点击:完成创建
+                // 锟节讹拷锟轿碉拷锟斤拷锟斤拷锟缴达拷锟斤拷
                 m_isCreating = false;
                 QPointF endPos = mapToScene(event->pos());
                 scene()->removeItem(m_pTempLine);
@@ -147,17 +147,17 @@ void ImageView::mouseMoveEvent(QMouseEvent* event) {
     }
 
     if (m_bMouseTranslate) {
-        // 计算鼠标当前位置与上次位置的差值
+        // 锟斤拷锟斤拷锟斤拷甑鼻拔伙拷锟斤拷锟斤拷洗锟轿伙拷玫牟锟街�
         QPointF delta = event->pos() - m_lastMousePos;
-        // 平移视
+        // 平锟斤拷锟斤拷
         horizontalScrollBar()->setValue(horizontalScrollBar()->value() - delta.x());
         verticalScrollBar()->setValue(verticalScrollBar()->value() - delta.y());
-        m_lastMousePos = event->pos();  // 更新鼠标位置
+        m_lastMousePos = event->pos();  // 锟斤拷锟斤拷锟斤拷锟轿伙拷锟�
     }
     else if ((event->buttons() & Qt::RightButton) && m_isDrawing && m_rightButtonPressed) {
         if (!m_curDrawing && (event->pos() - m_rightClickPressPos).manhattanLength() > 5) {
             m_curDrawing = true;
-            // 根据初始位置开始绘制路径
+            // 锟斤拷锟捷筹拷始位锟矫匡拷始锟斤拷锟斤拷路锟斤拷
             QPointF scenePos = mapToScene(m_rightClickPressPos);
             m_currentPath = QPainterPath(scenePos);
             m_currentPathItem = new QGraphicsPathItem();
@@ -167,7 +167,6 @@ void ImageView::mouseMoveEvent(QMouseEvent* event) {
             scene()->addItem(m_currentPathItem);
             m_drawnPaths.append(m_currentPathItem);
         }
-        // 如果已经处于绘制状态,则继续添加点
         if (m_curDrawing && m_currentPathItem) {
             QPointF scenePos = mapToScene(event->pos());
             m_currentPath.lineTo(scenePos);
@@ -181,13 +180,12 @@ void ImageView::mouseMoveEvent(QMouseEvent* event) {
 
 void ImageView::mouseReleaseEvent(QMouseEvent* event) {
     if (event->button() == Qt::LeftButton) {
-        setCursor(Qt::ArrowCursor);  // 松开时恢复为箭头
+        setCursor(Qt::ArrowCursor);  
         m_bMouseTranslate = false;
     }
     else if (event->button() == Qt::RightButton && m_rightButtonPressed) {
         if (!m_curDrawing) {
             if (!m_bRulerState) {
-                // 右键点击(无拖动),弹出菜单
                 QMenu menu(this);
                 QAction* act1 = menu.addAction(tr("save picture"));
                 QAction* act2 = menu.addAction(tr("clear"));
@@ -202,11 +200,10 @@ void ImageView::mouseReleaseEvent(QMouseEvent* event) {
             }
         }
         else {
-            // 绘制结束
             m_currentPathItem = nullptr;
             m_curDrawing = false;
         }
-        // 恢复状态
+
         m_rightButtonPressed = false;
         event->accept();
         return;
@@ -217,7 +214,7 @@ void ImageView::mouseReleaseEvent(QMouseEvent* event) {
 void ImageView::wheelEvent(QWheelEvent* event)
 {
     if (event->orientation() == Qt::Vertical) {
-        event->ignore(); // 忽略竖直滚轮事件(即禁用滚动条滑动)
+        event->ignore(); // 锟斤拷锟斤拷锟斤拷直锟斤拷锟斤拷锟铰硷拷锟斤拷锟斤拷锟斤拷锟矫癸拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷
         return;
     }
     event->accept();
@@ -226,13 +223,13 @@ void ImageView::wheelEvent(QWheelEvent* event)
 void ImageView::resizeEvent(QResizeEvent* event)
 {
     QGraphicsView::resizeEvent(event);
-    viewport()->update();  // 窗口大小改变时重绘十字线
+    viewport()->update();  // 锟斤拷锟节达拷小锟侥憋拷时锟截伙拷十锟斤拷锟斤拷
 }
 
 void ImageView::scrollContentsBy(int dx, int dy)
 {
     QGraphicsView::scrollContentsBy(dx, dy);
-    viewport()->update();  // 滚动时更新十字线
+    viewport()->update();  // 锟斤拷锟斤拷时锟斤拷锟斤拷十锟斤拷锟斤拷
 }
 
 void ImageView::drawCrosshair(QPainter& painter)
@@ -241,50 +238,50 @@ void ImageView::drawCrosshair(QPainter& painter)
     int resolutionWidth = viewRect.width();
     int resolutionHeight = viewRect.height();
     painter.setPen(QPen(QColor(139, 105, 20, 255), 1));
-    // 绘制垂直线
+    // 锟斤拷锟狡达拷直锟斤拷
     painter.drawLine(resolutionWidth / 2, 0, resolutionWidth / 2, resolutionHeight);
-    // 绘制水平线
+    // 锟斤拷锟斤拷水平锟斤拷
     painter.drawLine(0, resolutionHeight / 2, resolutionWidth, resolutionHeight / 2);
 
     int centerX = resolutionWidth / 2;
     int centerY = resolutionHeight / 2;
 
-    int rulerLength = viewRect.width(); // 量尺长度
-    int tickSpacing = 5; // 刻度间距
+    int rulerLength = viewRect.width(); // 锟斤拷锟竭筹拷锟斤拷
+    int tickSpacing = 5; // 锟教度硷拷锟�
 
-    // 绘制水平中心线上的量尺
+    // 锟斤拷锟斤拷水平锟斤拷锟斤拷锟斤拷锟较碉拷锟斤拷锟斤拷
     int rulerStartXHorizontal = centerX;
     int rulerStartYHorizontal = centerY;
 
     for (int i = 0; i <= rulerLength / 2; i += tickSpacing) {
         int tickHeight = 0;
-        if (i % (tickSpacing * 10) == 0) { // 长刻度
+        if (i % (tickSpacing * 10) == 0) { // 锟斤拷锟教讹拷
             tickHeight = 15;
         }
-        else if (i % (tickSpacing * 5) == 0) { // 中等刻度
+        else if (i % (tickSpacing * 5) == 0) { // 锟叫等刻讹拷
             tickHeight = 10;
         }
-        else { // 短刻度
+        else { // 锟教刻讹拷
             tickHeight = 5;
         }
 
-        painter.drawLine(rulerStartXHorizontal + i, rulerStartYHorizontal, rulerStartXHorizontal + i, rulerStartYHorizontal - tickHeight); // 绘制刻度线
-        painter.drawLine(rulerStartXHorizontal - i, rulerStartYHorizontal, rulerStartXHorizontal - i, rulerStartYHorizontal - tickHeight); // 绘制刻度线
+        painter.drawLine(rulerStartXHorizontal + i, rulerStartYHorizontal, rulerStartXHorizontal + i, rulerStartYHorizontal - tickHeight); // 锟斤拷锟狡刻讹拷锟斤拷
+        painter.drawLine(rulerStartXHorizontal - i, rulerStartYHorizontal, rulerStartXHorizontal - i, rulerStartYHorizontal - tickHeight); // 锟斤拷锟狡刻讹拷锟斤拷
     }
 
-    // 绘制垂直中心线上的量尺
+    // 锟斤拷锟狡达拷直锟斤拷锟斤拷锟斤拷锟较碉拷锟斤拷锟斤拷
     int rulerStartXVertical = centerX; 
     int rulerStartYVertical = centerY;
 
     for (int i = 0; i <= rulerLength / 2; i += tickSpacing) {
         int tickWidth = 0;
-        if (i % (tickSpacing * 10) == 0) { // 长刻度
+        if (i % (tickSpacing * 10) == 0) { // 锟斤拷锟教讹拷
             tickWidth = 15;
         }
-        else if (i % (tickSpacing * 5) == 0) { // 中等刻度
+        else if (i % (tickSpacing * 5) == 0) { // 锟叫等刻讹拷
             tickWidth = 10;
         }
-        else { // 短刻度
+        else { // 锟教刻讹拷
             tickWidth = 5;
         }
         painter.drawLine(rulerStartXVertical, rulerStartYVertical - i, rulerStartXVertical - tickWidth, rulerStartYVertical - i);
@@ -294,14 +291,14 @@ void ImageView::drawCrosshair(QPainter& painter)
 
 void ImageView::saveImage()
 {
-    // 使用当前时间生成默认文件名
+    // 使锟矫碉拷前时锟斤拷锟斤拷锟斤拷默锟斤拷锟侥硷拷锟斤拷
     QString defaultFileName = QDateTime::currentDateTime().toString("yyyy-MM-dd_HH-mm-ss") + ".png";
 
     QString fileName = QFileDialog::getSaveFileName(
         this,
-        tr("保存图片"),
-        QDir::homePath() + "/" + defaultFileName, // 默认路径为用户目录,文件名为当前时间
-        tr("PNG 文件 (*.png);;JPEG 文件 (*.jpg);;所有文件 (*)")
+        tr("锟斤拷锟斤拷图片"),
+        QDir::homePath() + "/" + defaultFileName, // 默锟斤拷路锟斤拷为锟矫伙拷目录锟斤拷锟侥硷拷锟斤拷为锟斤拷前时锟斤拷
+        tr("PNG 锟侥硷拷 (*.png);;JPEG 锟侥硷拷 (*.jpg);;锟斤拷锟斤拷锟侥硷拷 (*)")
     );
     if (!fileName.isEmpty()) {
         QImage image(viewport()->size(), QImage::Format_ARGB32);
@@ -309,10 +306,10 @@ void ImageView::saveImage()
         QPainter painter(&image);
         this->render(&painter);
         if (!image.save(fileName)) {
-            QMessageBox::warning(this, tr("保存失败"), tr("无法保存图片到指定路径。"));
+            QMessageBox::warning(this, tr("锟斤拷锟斤拷失锟斤拷"), tr("锟睫凤拷锟斤拷锟斤拷图片锟斤拷指锟斤拷路锟斤拷锟斤拷"));
         }
         else {
-            QMessageBox::information(this, tr("保存成功"), tr("图片已成功保存到:") + fileName);
+            QMessageBox::information(this, tr("锟斤拷锟斤拷晒锟�"), tr("图片锟窖成癸拷锟斤拷锟芥到锟斤拷") + fileName);
         }
         painter.end();
     }

+ 66 - 6
View/die-bonder-ui/OriginalWnd/ChartsAndCamerasWnd.cpp

@@ -58,7 +58,7 @@ ChartsAndCamerasWnd::ChartsAndCamerasWnd(QWidget* parent) :
         ui->RedHorizontalLinecheckBox,
         ui->WhiteVerticalBarcheckBox
     };
-
+    connect(ui->viewwidgetgroup, &ControlOperationPage::send_ComboBox_singal, this, &ChartsAndCamerasWnd::HandleComboxchange);
     for (QCheckBox* cb : checkBoxes) {
         cb->setCheckable(true);
 
@@ -246,7 +246,11 @@ void ChartsAndCamerasWnd::initFrom() {
         for (int i = 0; i < numbers.size(); ++i)
         {
             int num = numbers[i];
-            CameraImageHandler* manager = new CameraImageHandler(num);
+            CameraInfo test;
+            test.iCameraId = i;
+            test.name = ("camera" + QString::number(i)).toStdString();
+            test.eType = MATERIAL_WAFER;
+            CameraImageHandler* manager = new CameraImageHandler(num, test);
             Group* widget = manager->getGroup();
             //connect(widget,&Group::send_button_Signal,this,&ChartsAndCamerasWnd::showAndHide);
             if (widget != nullptr)
@@ -254,6 +258,8 @@ void ChartsAndCamerasWnd::initFrom() {
                 CameraConnectUpdateImageFun(i, widget);
                 connect(widget, &Group::sendUpdateGroupState,
                     this, &ChartsAndCamerasWnd::checkSettings);
+                connect(widget, &Group::send_ComboBox_singal,
+                    this, &ChartsAndCamerasWnd::GetGroupComboxChanged);
                 layout->addWidget(widget);
                 m_allGroup.append(widget);
             }
@@ -272,6 +278,9 @@ void ChartsAndCamerasWnd::initFrom() {
             if (manager->getBond()) {
                 bondMap.insert(num, manager->getBond());
             }
+            if (!manager->getFileList().isEmpty()) {
+                m_mapFileListMap.insert(num, manager->getFileList());
+            }
 
             delete manager;
         }
@@ -496,6 +505,12 @@ void ChartsAndCamerasWnd::initWidget() {
         lastIndex = 1;
         m_veCurrentSelectGroup.isInitialed = true;
         m_veCurrentSelectGroup.pSelectGroup = m_allGroup.at(lastGroupId - 1);
+        m_veCurrentSelectGroup.pSelectGroup->initBorderStyle(lastIndex, 1);
+        //初始化下拉框内容同步小窗口索引
+        int currentComboBoxIndex = m_veCurrentSelectGroup.pSelectGroup->getCurrentComboBoxIndex();
+        ui->viewwidgetgroup->setEnableControls(true);
+        ui->viewwidgetgroup->setComboBox(m_mapFileListMap[m_veCurrentSelectGroup.pSelectGroup->m_nGroupId], currentComboBoxIndex);
+        BindImageOrMaterial(m_nImageIndex);
 
         BindImageOrMaterial(m_nImageIndex);
 
@@ -504,13 +519,17 @@ void ChartsAndCamerasWnd::initWidget() {
     }
     m_veCurrentSelectGroup.isInitialed = true;
     m_veCurrentSelectGroup.pSelectGroup = m_allGroup.at(lastGroupId - 1);
+    m_veCurrentSelectGroup.pSelectGroup->initBorderStyle(lastIndex, 1);
+    //初始化下拉框内容同步小窗口索引
+    int currentComboBoxIndex = m_veCurrentSelectGroup.pSelectGroup->getCurrentComboBoxIndex();
+    ui->viewwidgetgroup->setComboBox(m_mapFileListMap[m_veCurrentSelectGroup.pSelectGroup->m_nGroupId], currentComboBoxIndex);
     if (lastIndex == 1) {
-
+        ui->viewwidgetgroup->setEnableControls(true);
         BindImageOrMaterial(m_nImageIndex);
 
     }
     else {
-
+        ui->viewwidgetgroup->setEnableControls(false);
         BindImageOrMaterial(m_nMaterialIndex);
 
     }
@@ -539,13 +558,20 @@ void ChartsAndCamerasWnd::GetCurrentSelectSlots(int groupId, int nIndex) {
     m_veCurrentSelectGroup.pSelectGroup = m_allGroup.at(nOnClickGroupId);
     //判断index是相机还是物料
     if (nIndex == 2) {
-
+        ui->viewwidgetgroup->setEnableControls(false);
         BindImageOrMaterial(m_nMaterialIndex);
 
     }
     else if (nIndex == 1) {
-        
+
+        //更新下拉框内容同步小窗口索引
+        int currentComboBoxIndex = m_veCurrentSelectGroup.pSelectGroup->getCurrentComboBoxIndex();
+        ui->viewwidgetgroup->setEnableControls(true);
+        ui->viewwidgetgroup->setComboBox(m_mapFileListMap[m_veCurrentSelectGroup.pSelectGroup->m_nGroupId], currentComboBoxIndex);
         BindImageOrMaterial(m_nImageIndex);
+        QPixmap pixmap = ui->viewwidgetgroup->getCurrentComboBoxPixmap(currentComboBoxIndex);
+        GetGroupImageShowSignals(pixmap);
+
     }
 }
 
@@ -578,5 +604,39 @@ void ChartsAndCamerasWnd::UpdataLightJoystickSwitchPage(int groupId, bool isShow
 
 }
 
+void ChartsAndCamerasWnd::GetGroupComboxChanged(int groupId, int comboxIndex) {
+
+    m_allGroup.at(groupId - 1);
+    if (comboxIndex == 0) {
+        CameraConnectUpdateImageFun(groupId - 1, m_allGroup.at(groupId - 1), false);
+
+    }
+    else {
+        CameraConnectUpdateImageFun(groupId - 1, m_allGroup.at(groupId - 1), true);
+
+    }
+    m_allGroup.at(groupId - 1)->setCurrentCombox(comboxIndex);
+
+    if (groupId == m_veCurrentSelectGroup.pSelectGroup->m_nGroupId && lastIndex == 1) {
+
+        if (comboxIndex != 0) {//图片
+            QPixmap updatePixmap = ui->viewwidgetgroup->getCurrentComboBoxPixmap(comboxIndex);
+            m_veCurrentSelectGroup.pSelectGroup->UpDataImageShowSlots(updatePixmap);
+        }
+    }
+
+}
+
+void ChartsAndCamerasWnd::HandleComboxchange(int index) {
+    if (index == 0) {
+        CameraConnectUpdateImageFun(m_veCurrentSelectGroup.pSelectGroup->m_nGroupId - 1, m_allGroup.at(m_veCurrentSelectGroup.pSelectGroup->m_nGroupId - 1), false);
+    }
+    else {
+        CameraConnectUpdateImageFun(m_veCurrentSelectGroup.pSelectGroup->m_nGroupId - 1, m_allGroup.at(m_veCurrentSelectGroup.pSelectGroup->m_nGroupId - 1), true);
+        QPixmap updatePixmap = ui->viewwidgetgroup->getCurrentComboBoxPixmap(index);
+        m_veCurrentSelectGroup.pSelectGroup->UpDataImageShowSlots(updatePixmap);
+    }
+}
+
 
 

+ 3 - 0
View/die-bonder-ui/OriginalWnd/ChartsAndCamerasWnd.h

@@ -45,6 +45,7 @@ protected:
 public slots: // 确保这里声明了槽函数
 
     void GetGroupImageShowSignals(const QPixmap& imageData);
+    void GetGroupComboxChanged(int groupId, int comboxIndex);
 
 private:
     void InitMainCameraBind(CameraBind* pCameraBind) override;
@@ -69,6 +70,7 @@ signals:
 private slots:
 
     void GetCurrentSelectSlots(int groupId, int nIndex);
+    void HandleComboxchange(int index);
     QPixmap getCurrentPixmap() const {
         return currentPixmap;
     }
@@ -134,6 +136,7 @@ private:
     QMap<int, Waffle*> waffleMap;
     QMap<int, MaterialBox*> materialBoxMap;
     QMap<int, Bond*> bondMap;
+    QMap<int, QList<QPair<QString, QString>>>            m_mapFileListMap;
     OperateMode currentMode = ModeImage;
     QGraphicsView* currentView = nullptr;
     QPoint mousePos;

+ 139 - 87
View/die-bonder-ui/OriginalWnd/MainAndSecondaryCamerasWnd.cpp

@@ -10,7 +10,7 @@
 #include "Src/common/JMessageTip.h"
 
 
-MainAndSecondaryCamerasWnd::MainAndSecondaryCamerasWnd(QWidget *parent)
+MainAndSecondaryCamerasWnd::MainAndSecondaryCamerasWnd(QWidget* parent)
     : JOriginalMainWnd(parent)
     , ui(new Ui::MainAndSecondaryCamerasWnd)
 {
@@ -18,19 +18,13 @@ MainAndSecondaryCamerasWnd::MainAndSecondaryCamerasWnd(QWidget *parent)
 
 
 
-    QString buildDirPath = QCoreApplication::applicationDirPath();
-    QDir buildDirectory(buildDirPath);
-    QStringList files = getImageslist(buildDirectory.filePath("photos"));
-    for (const QString& file : files) {
-        qDebug() << file;
-    }
+
     ui->control_r->HideOrShowPage(false);
     ui->control_L->HideOrShowPage(false);
     ui->viewwidgetgroup_L->setBlueBord();
+    connect(ui->viewwidgetgroup_L, &ControlOperationPage::send_ComboBox_singal, this, &MainAndSecondaryCamerasWnd::HandleComboxchange_L);
+    connect(ui->viewwidgetgroup_R, &ControlOperationPage::send_ComboBox_singal, this, &MainAndSecondaryCamerasWnd::HandleComboxchange_R);
     qApp->installEventFilter(this);
-
-    m_veCurrentSelectGroup_R = {};
-    m_veCurrentSelectGroup_L = {};
     m_veCurrentSelectGroup_R.isInitialed = false;
     m_veCurrentSelectGroup_L.isInitialed = false;
     m_veCurrentSelectGroup_R.isBond = false;
@@ -45,7 +39,7 @@ MainAndSecondaryCamerasWnd::~MainAndSecondaryCamerasWnd()
 
 void MainAndSecondaryCamerasWnd::initFrom()
 {
- 
+
     {
         // 界面刷新
         InitPage();
@@ -63,7 +57,7 @@ void MainAndSecondaryCamerasWnd::initFrom()
         //SwitchToConfigAAAAA<MainAndSecondaryCamerasWnd, STR_TEMPLATE>();
 
     }
-    
+
     //ui->LeftOperatewidget->setMouseTracking(true);
     //ui->RightOperatewidget->setMouseTracking(true);
 
@@ -90,7 +84,7 @@ void MainAndSecondaryCamerasWnd::InitPage()
             //JMessageTip::Message_warning("a");
         }
         QList<int> numbers;
-        
+
         for (int i = 1; i <= nSize; i++)
         {
             numbers.push_back(i);
@@ -99,12 +93,18 @@ void MainAndSecondaryCamerasWnd::InitPage()
         for (int i = 0; i < numbers.size(); ++i)
         {
             int num = numbers[i];
-            CameraImageHandler* manager = new CameraImageHandler(num);
+            CameraInfo test; 
+            test.iCameraId = i;
+            test.name = ("camera" + QString::number(i)).toStdString();
+            test.eType = MATERIAL_WAFER;
+            CameraImageHandler* manager = new CameraImageHandler(num,test);
             Group* widget = manager->getGroup();
             CameraConnectUpdateImageFun(i, widget);
 
             connect(widget, &Group::sendUpdateGroupState,
                 this, &MainAndSecondaryCamerasWnd::checkSettings);
+            connect(widget, &Group::send_ComboBox_singal,
+                this, &MainAndSecondaryCamerasWnd::GetGroupComboxChanged);
             if (widget != nullptr)
             {
                 mainLayout->addWidget(widget);
@@ -123,6 +123,9 @@ void MainAndSecondaryCamerasWnd::InitPage()
             if (manager->getBond()) {
                 m_mapBondMap.insert(num, manager->getBond());
             }
+            if(!manager->getFileList().isEmpty()){
+                m_mapFileListMap.insert(num, manager->getFileList());
+            }
             delete manager;
         }
 
@@ -130,11 +133,11 @@ void MainAndSecondaryCamerasWnd::InitPage()
         int minHeight = 162;
         int maxWidth = 244;
         int num = -28;
-        for(Group* w : m_allGroup)
+        for (Group* w : m_allGroup)
         {
-        w->setMinimumHeight(minHeight);
-        w->setMaximumWidth(maxWidth);
-        num = num + 272;
+            w->setMinimumHeight(minHeight);
+            w->setMaximumWidth(maxWidth);
+            num = num + 272;
         }
 
         container->setMinimumSize(num, 162);
@@ -171,12 +174,13 @@ void MainAndSecondaryCamerasWnd::CameraConnectUpdateImageFun(int nIndex, Group*
     {
         if (isUnCameraBind)
         {
-            //disconnect(widget, &Group::SetCurrentSelectSig, this, &MainAndSecondaryCamerasWnd::GetCurrentSelectSlots);
+            disconnect(widget, &Group::SetCurrentSelectSig, this, &MainAndSecondaryCamerasWnd::GetCurrentSelectSlots);
             disconnect(this, pCamerasImage, widget, &Group::UpDataImageShowSlots);
         }
         else
         {
             //共用函数
+            //connect(widget, &Group::send_button_Signal, this, &MainAndSecondaryCamerasWnd::CheckIs);
             // connect(widget, &Group::SetCurrentSelectSig, this, &MainAndSecondaryCamerasWnd::GetCurrentSelectSlots);
             connect(this, pCamerasImage, widget, &Group::UpDataImageShowSlots);
         }
@@ -231,63 +235,77 @@ void MainAndSecondaryCamerasWnd::initLeftAndRightWidget() {
         lastGroupId = 1;
         lastIndex = 1;
         lastLastGroupId = 1;
-        lastLastGroupId = 2;
+        lastLastIndex = 2;
         
     }
     m_veCurrentSelectGroup_R.isInitialed = true;
     m_veCurrentSelectGroup_L.isInitialed = true;
 
     if (m_allGroup.size() == 1) {
-
         m_veCurrentSelectGroup_L.pSelectGroup = m_allGroup.at(lastGroupId - 1);
         m_veCurrentSelectGroup_R.pSelectGroup = m_allGroup.at(lastGroupId - 1);
+        m_veCurrentSelectGroup_L.pSelectGroup->initBorderStyle(lastLastIndex,0);
+        m_veCurrentSelectGroup_R.pSelectGroup->initBorderStyle(lastIndex, 1);
+        int currentLeftComboBoxIndex = m_veCurrentSelectGroup_L.pSelectGroup->getCurrentComboBoxIndex();
+        ui->viewwidgetgroup_L->setComboBox(m_mapFileListMap[m_veCurrentSelectGroup_L.pSelectGroup->m_nGroupId],currentLeftComboBoxIndex);
+        int currentRightComboBoxIndex = m_veCurrentSelectGroup_R.pSelectGroup->getCurrentComboBoxIndex();
+        ui->viewwidgetgroup_R->setComboBox(m_mapFileListMap[m_veCurrentSelectGroup_R.pSelectGroup->m_nGroupId],currentRightComboBoxIndex);
         if (lastIndex != lastLastIndex) {
 
             if (lastIndex == 1) {
                 BindImageOrMaterial(m_nCurrentRight, m_nImageIndex);
+                ui->viewwidgetgroup_R->setEnableControls(true);
                 BindImageOrMaterial(m_nLastLeft, m_nMaterialIndex);
+                ui->viewwidgetgroup_L->setEnableControls(false);
             }
             else {
                 BindImageOrMaterial(m_nCurrentRight, m_nMaterialIndex);
+                ui->viewwidgetgroup_R->setEnableControls(false);
                 BindImageOrMaterial(m_nLastLeft, m_nImageIndex);
-
+                ui->viewwidgetgroup_L->setEnableControls(true);
+                
             }
 
         }
         else {
             BindImageOrMaterial(m_nCurrentRight, m_nMaterialIndex);
+            ui->viewwidgetgroup_R->setEnableControls(true);
             BindImageOrMaterial(m_nLastLeft, m_nImageIndex);
+            ui->viewwidgetgroup_L->setEnableControls(false);
 
         }
     }
     else {
-        if (lastLastGroupId > m_allGroup.size() || lastGroupId > m_allGroup.size()) {
-            //重置记录
-            lastGroupId = 1;
-            lastIndex = 1;
-            lastLastGroupId = 1;
-            lastLastGroupId = 2;
-        }
 
         m_veCurrentSelectGroup_L.pSelectGroup = m_allGroup.at(lastLastGroupId - 1);
         m_veCurrentSelectGroup_R.pSelectGroup = m_allGroup.at(lastGroupId - 1);
+        m_veCurrentSelectGroup_L.pSelectGroup->initBorderStyle(lastLastIndex, 0);
+        m_veCurrentSelectGroup_R.pSelectGroup->initBorderStyle(lastIndex, 1);
+        int currentLeftComboBoxIndex = m_veCurrentSelectGroup_L.pSelectGroup->getCurrentComboBoxIndex();
+        ui->viewwidgetgroup_L->setComboBox(m_mapFileListMap[m_veCurrentSelectGroup_L.pSelectGroup->m_nGroupId],currentLeftComboBoxIndex);
+        int currentRightComboBoxIndex = m_veCurrentSelectGroup_R.pSelectGroup->getCurrentComboBoxIndex();
+        ui->viewwidgetgroup_R->setComboBox(m_mapFileListMap[m_veCurrentSelectGroup_R.pSelectGroup->m_nGroupId],currentRightComboBoxIndex);
         if (lastLastIndex == 1) {
 
             BindImageOrMaterial(m_nLastLeft, m_nImageIndex);
+            ui->viewwidgetgroup_L->setEnableControls(true);
 
         }
         else {
 
             BindImageOrMaterial(m_nLastLeft, m_nMaterialIndex);
+            ui->viewwidgetgroup_L->setEnableControls(false);
 
         }
 
         if (lastIndex == 1) {
             BindImageOrMaterial(m_nCurrentRight, m_nImageIndex);
+            ui->viewwidgetgroup_R->setEnableControls(true);
 
         }
         else {
             BindImageOrMaterial(m_nCurrentRight, m_nMaterialIndex);
+            ui->viewwidgetgroup_R->setEnableControls(false);
 
         }
     }
@@ -302,10 +320,10 @@ void MainAndSecondaryCamerasWnd::BindImageOrMaterial(int location, int index) {
             m_veCurrentSelectGroup_L.isBond = true;
             connect(m_veCurrentSelectGroup_L.pSelectGroup, &Group::SetUpDataImageShowSig,
                 this, &MainAndSecondaryCamerasWnd::GetGroupImageShowSignalsTo_L);
-            ui->viewwidgetgroup_L->initImage();
             UpdataLightJoystickSwitchPage(m_veCurrentSelectGroup_L.pSelectGroup->m_nGroupId, 1, true);
 
-        }else {
+        }
+        else {
             //左边更新物料窗口
             QSettings settings("YourOrganization", "YourApplication");
             settings.beginGroup(QString::number(m_veCurrentSelectGroup_L.pSelectGroup->m_nGroupId));
@@ -316,13 +334,13 @@ void MainAndSecondaryCamerasWnd::BindImageOrMaterial(int location, int index) {
             updateMaterialWidget(m_nLastLeft, lastMaterialWndType, m_veCurrentSelectGroup_L.pSelectGroup->m_nGroupId);
 
         }
-    }else {
+    }
+    else {
         if (index == m_nImageIndex) {
 
             m_veCurrentSelectGroup_R.isBond = true;
             connect(m_veCurrentSelectGroup_R.pSelectGroup, &Group::SetUpDataImageShowSig,
                 this, &MainAndSecondaryCamerasWnd::GetGroupImageShowSignalsTo_R);
-            ui->viewwidgetgroup_R->initImage();
             UpdataLightJoystickSwitchPage(m_veCurrentSelectGroup_R.pSelectGroup->m_nGroupId, 2, true);
 
         }
@@ -341,7 +359,7 @@ void MainAndSecondaryCamerasWnd::BindImageOrMaterial(int location, int index) {
     }
 }
 
-void MainAndSecondaryCamerasWnd::checkSettings(int groupId,int index) {
+void MainAndSecondaryCamerasWnd::checkSettings(int groupId, int index) {
 
 
     if (groupId != lastGroupId || index != lastIndex) {
@@ -360,20 +378,18 @@ void MainAndSecondaryCamerasWnd::saveInfoOfLast() {
     QSettings settings("YourOrganization", "YourApplication");
     settings.setValue("DoubleLastIndex", lastIndex);
     settings.setValue("DoubleLastGroupId", lastGroupId);
-
     settings.setValue("DoubleLastLastIndex", lastLastIndex);
     settings.setValue("DoubleLastLastGroupId", lastLastGroupId);
 
 }
 
-
-void MainAndSecondaryCamerasWnd::updateMaterialWidget(int  side,int materialWndType, int groupId) {
+void MainAndSecondaryCamerasWnd::updateMaterialWidget(int  side, int materialWndType, int groupId) {
     if (side == m_nLastLeft) {
         switch (materialWndType) {
         case 1: ui->viewwidgetgroup_L->setWafer(m_mapWaferMap.value(groupId)); break;
         case 2: ui->viewwidgetgroup_L->setWaffle(m_mapWaffleMap.value(groupId)); break;
         case 3: ui->viewwidgetgroup_L->setMaterialBox(m_mapMaterialBoxMap.value(groupId)); break;
-		case 4: ui->viewwidgetgroup_L->setBond(m_mapBondMap.value(groupId)); break;
+        case 4: ui->viewwidgetgroup_L->setBond(m_mapBondMap.value(groupId)); break;
         }
     }
     else if (side == m_nCurrentRight) {
@@ -381,7 +397,7 @@ void MainAndSecondaryCamerasWnd::updateMaterialWidget(int  side,int materialWndT
         case 1: ui->viewwidgetgroup_R->setWafer(m_mapWaferMap.value(groupId)); break;
         case 2: ui->viewwidgetgroup_R->setWaffle(m_mapWaffleMap.value(groupId)); break;
         case 3: ui->viewwidgetgroup_R->setMaterialBox(m_mapMaterialBoxMap.value(groupId)); break;
-		case 4: ui->viewwidgetgroup_R->setBond(m_mapBondMap.value(groupId)); break;
+        case 4: ui->viewwidgetgroup_R->setBond(m_mapBondMap.value(groupId)); break;
         }
     }
 }
@@ -398,18 +414,6 @@ void MainAndSecondaryCamerasWnd::UnCameraBind()
     {
         CameraConnectUpdateImageFun(i, m_allGroup[i], true);
     }
-    //判断更新前的左窗口是否是绑定相机
-    if (m_veCurrentSelectGroup_L.isBond == true) {
-        disconnect(m_veCurrentSelectGroup_L.pSelectGroup, &Group::SetUpDataImageShowSig,
-            this, &MainAndSecondaryCamerasWnd::GetGroupImageShowSignalsTo_L);
-    }
-
-    //判断更新前的右窗口是否是绑定相机
-    if (m_veCurrentSelectGroup_R.isBond == true) {
-        //解绑
-        disconnect(m_veCurrentSelectGroup_R.pSelectGroup, &Group::SetUpDataImageShowSig,
-            this, &MainAndSecondaryCamerasWnd::GetGroupImageShowSignalsTo_R);
-    }
 }
 
 void MainAndSecondaryCamerasWnd::UpdateCameraDisplay0(int iCameraId, JVision::ImageInfo imageData)
@@ -483,7 +487,7 @@ void MainAndSecondaryCamerasWnd::HideLayout(QHBoxLayout* layout, bool isHide)
 
 void MainAndSecondaryCamerasWnd::UpdataLightJoystickSwitchPage(int groupId, int index, bool isShow)
 {
-    auto Fun = [&](Group* pGroup,LightJoystickSwitchPage* p, ControlOperationPage* pContPage, bool bShow)
+    auto Fun = [&](Group* pGroup, LightJoystickSwitchPage* p, ControlOperationPage* pContPage, bool bShow)
     {
         p->UpdatemPageGroup(pGroup);
         p->InitMainCameraBind(m_pMainCameraBind, bShow);
@@ -498,21 +502,21 @@ void MainAndSecondaryCamerasWnd::UpdataLightJoystickSwitchPage(int groupId, int
         }
 
     };
-    
+
     if (index == 1)
     {
         disconnect(ui->viewwidgetgroup_L, &ControlOperationPage::SendModuleTypeSignals,
             ui->control_L, &LightJoystickSwitchPage::GetModuleTypeSlots);
-        Group* currGroup = m_allGroup.at(groupId-1);
+        Group* currGroup = m_allGroup.at(groupId - 1);
         Fun(currGroup, ui->control_L, ui->viewwidgetgroup_L, isShow);
-        connect(ui->viewwidgetgroup_L, &ControlOperationPage::SendModuleTypeSignals, 
-            ui->control_L,&LightJoystickSwitchPage::GetModuleTypeSlots);
+        connect(ui->viewwidgetgroup_L, &ControlOperationPage::SendModuleTypeSignals,
+            ui->control_L, &LightJoystickSwitchPage::GetModuleTypeSlots);
     }
-    else if(index == 2)
+    else if (index == 2)
     {
         disconnect(ui->viewwidgetgroup_R, &ControlOperationPage::SendModuleTypeSignals,
             ui->control_r, &LightJoystickSwitchPage::GetModuleTypeSlots);
-        Group* currGroup = m_allGroup.at(groupId-1);
+        Group* currGroup = m_allGroup.at(groupId - 1);
         Fun(currGroup, ui->control_r, ui->viewwidgetgroup_R, isShow);
         connect(ui->viewwidgetgroup_R, &ControlOperationPage::SendModuleTypeSignals,
             ui->control_r, &LightJoystickSwitchPage::GetModuleTypeSlots);
@@ -546,16 +550,27 @@ void MainAndSecondaryCamerasWnd::GetCurrentSelectSlots(int groupId, int nIndex)
             this, &MainAndSecondaryCamerasWnd::GetGroupImageShowSignalsTo_R);
     }
 
+    
+
     m_veCurrentSelectGroup_L = m_veCurrentSelectGroup_R;
+
     //判断更新前的右窗口的index是相机还是物料
     if (lastIndex == 1) {
         //左窗口绑定
-
+        //更新左边的下拉框内容同步小窗口索引
+        int currentLeftComboBoxIndex = m_veCurrentSelectGroup_L.pSelectGroup->getCurrentComboBoxIndex();
+        ui->viewwidgetgroup_L->setEnableControls(true);
+        ui->viewwidgetgroup_L->setComboBox(m_mapFileListMap[m_veCurrentSelectGroup_L.pSelectGroup->m_nGroupId],currentLeftComboBoxIndex);
+        
         BindImageOrMaterial(m_nLastLeft, m_nImageIndex);
+        QPixmap pixmap = ui->viewwidgetgroup_L->getCurrentComboBoxPixmap(currentLeftComboBoxIndex);
+        GetGroupImageShowSignalsTo_L(pixmap);
+
+        
 
     }
     else {
-
+        ui->viewwidgetgroup_L->setEnableControls(false);
         BindImageOrMaterial(m_nLastLeft, m_nMaterialIndex);
 
     }
@@ -563,13 +578,18 @@ void MainAndSecondaryCamerasWnd::GetCurrentSelectSlots(int groupId, int nIndex)
     m_veCurrentSelectGroup_R.pSelectGroup = m_allGroup.at(nOnClickGroupId);
     //判断当前index是相机还是物料
     if (nIndex == 2) {
-
+        ui->viewwidgetgroup_R->setEnableControls(false);
         BindImageOrMaterial(m_nCurrentRight, m_nMaterialIndex);
 
     }
     else if (nIndex == 1) {//当前切换时相机序号
+        int currentRightComboBoxIndex = m_veCurrentSelectGroup_R.pSelectGroup->getCurrentComboBoxIndex();
+        ui->viewwidgetgroup_R->setEnableControls(true);
+        ui->viewwidgetgroup_R->setComboBox(m_mapFileListMap[m_veCurrentSelectGroup_R.pSelectGroup->m_nGroupId],currentRightComboBoxIndex);
 
         BindImageOrMaterial(m_nCurrentRight, m_nImageIndex);
+        QPixmap pixmap = ui->viewwidgetgroup_R->getCurrentComboBoxPixmap(currentRightComboBoxIndex);
+        GetGroupImageShowSignalsTo_R(pixmap);
     }
 
 
@@ -577,29 +597,25 @@ void MainAndSecondaryCamerasWnd::GetCurrentSelectSlots(int groupId, int nIndex)
 
 void MainAndSecondaryCamerasWnd::GetGroupImageShowSignalsTo_L(const QPixmap& imageData)
 {
-    //lastIndex = 1;
+
     QSize size_left = ui->viewwidgetgroup_L->getOperatewidget()->size();
-    QPixmap scaledPixmap_left = imageData.scaled(size_left, Qt::KeepAspectRatio, Qt::SmoothTransformation);
-    //ui->viewwidgetgroup_L->getOperatewidget()->setPixmap(scaledPixmap_left);
+    QPixmap scaledPixmap_left = m_lastRightPixmap.scaled(size_left, Qt::KeepAspectRatio, Qt::SmoothTransformation);
     ui->viewwidgetgroup_L->setScaleFactorSize(scaledPixmap_left);
+    m_lastRightPixmap = imageData;
 
-
-    // m_lastRightPixmap = imageData;
-    //UpdataGroupSettings(imageData);
 }
 
 void MainAndSecondaryCamerasWnd::GetGroupImageShowSignalsTo_R(const QPixmap& imageData)
 {
-    QSize size_right = ui->viewwidgetgroup_R->getOperatewidget()->size();
-    QPixmap scaledPixmap_right = imageData.scaled(size_right, Qt::KeepAspectRatio, Qt::SmoothTransformation);
-    //ui->viewwidgetgroup_R->getOperatewidget()->setPixmap(scaledPixmap_left);
+    QSize size_left = ui->viewwidgetgroup_R->getOperatewidget()->size();
+    QPixmap scaledPixmap_right = imageData.scaled(size_left, Qt::KeepAspectRatio, Qt::SmoothTransformation);
     ui->viewwidgetgroup_R->setScaleFactorSize(scaledPixmap_right);
-    // m_lastRightPixmap = imageData;
+    m_lastRightPixmap = imageData;
 }
 
 
 
-void MainAndSecondaryCamerasWnd::wheelEvent(QWheelEvent *event)
+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());
@@ -628,35 +644,71 @@ void MainAndSecondaryCamerasWnd::wheelEvent(QWheelEvent *event)
     //        scrollBar->setValue(scrollBar->value() + 50);
     //    }
     //}
-    
-	QMainWindow::wheelEvent(event);
+
+    QMainWindow::wheelEvent(event);
 }
 
-void MainAndSecondaryCamerasWnd::showEvent(QShowEvent *event) {
+void MainAndSecondaryCamerasWnd::showEvent(QShowEvent* event) {
     isUpdatingSettings = false;
     QMainWindow::showEvent(event);
 
+
     isUpdatingSettings = false;
 }
 
-void MainAndSecondaryCamerasWnd::hideEvent(QHideEvent *event) {
+void MainAndSecondaryCamerasWnd::hideEvent(QHideEvent* event) {
     isUpdatingSettings = false;
     QMainWindow::hideEvent(event);
 }
 
-QStringList MainAndSecondaryCamerasWnd::getImageslist(const QString& path) {
 
-    // 创建 QDir 对象
-    QDir dir(path);
 
-    // 检查文件夹是否存在
-    if (!dir.exists()) {
-        qWarning() << "Folder does not exist:" ;
+void MainAndSecondaryCamerasWnd::GetGroupComboxChanged(int groupId,int comboxIndex){
+
+    m_allGroup.at(groupId - 1);
+    if(comboxIndex == 0){
+        CameraConnectUpdateImageFun(groupId - 1,m_allGroup.at(groupId - 1),false);
+
+    }else{
+        CameraConnectUpdateImageFun(groupId - 1,m_allGroup.at(groupId - 1),true);
+        
     }
+    m_allGroup.at(groupId - 1)->setCurrentCombox(comboxIndex);
+    if(groupId == m_veCurrentSelectGroup_L.pSelectGroup->m_nGroupId && lastLastIndex == 1){
 
-    // 获取文件夹中的所有图片文件
-    QStringList filters;
-    filters << "*.png" << "*.jpg" << "*.jpeg" << "*.bmp" << "*.gif"; // 添加你需要的图片格式
-    QStringList fileList = dir.entryList(filters, QDir::Files);
-    return fileList;
+        if(comboxIndex != 0){//图片
+            QPixmap updatePixmap = ui->viewwidgetgroup_L->getCurrentComboBoxPixmap(comboxIndex);
+            m_veCurrentSelectGroup_L.pSelectGroup->UpDataImageShowSlots(updatePixmap);
+
+        }
+
+    }else if(groupId == m_veCurrentSelectGroup_R.pSelectGroup->m_nGroupId && lastIndex == 1){
+
+        if(comboxIndex != 0){//图片
+            QPixmap updatePixmap = ui->viewwidgetgroup_R->getCurrentComboBoxPixmap(comboxIndex);
+            m_veCurrentSelectGroup_R.pSelectGroup->UpDataImageShowSlots(updatePixmap);
+        }
+    }
+
+}
+
+void MainAndSecondaryCamerasWnd::HandleComboxchange_L(int index) {
+    if (index == 0) {
+        CameraConnectUpdateImageFun(m_veCurrentSelectGroup_L.pSelectGroup->m_nGroupId-1, m_allGroup.at(m_veCurrentSelectGroup_L.pSelectGroup->m_nGroupId - 1), false);
+    }
+    else {
+        CameraConnectUpdateImageFun(m_veCurrentSelectGroup_L.pSelectGroup->m_nGroupId - 1, m_allGroup.at(m_veCurrentSelectGroup_L.pSelectGroup->m_nGroupId - 1), true);
+        QPixmap updatePixmap = ui->viewwidgetgroup_L->getCurrentComboBoxPixmap(index);
+        m_veCurrentSelectGroup_L.pSelectGroup->UpDataImageShowSlots(updatePixmap);
+    }
+}
+void MainAndSecondaryCamerasWnd::HandleComboxchange_R(int index) {
+    if (index == 0) {
+        CameraConnectUpdateImageFun(m_veCurrentSelectGroup_R.pSelectGroup->m_nGroupId - 1, m_allGroup.at(m_veCurrentSelectGroup_R.pSelectGroup->m_nGroupId - 1), false);
+    }
+    else {
+        CameraConnectUpdateImageFun(m_veCurrentSelectGroup_R.pSelectGroup->m_nGroupId - 1, m_allGroup.at(m_veCurrentSelectGroup_R.pSelectGroup->m_nGroupId - 1), true);
+        QPixmap updatePixmap = ui->viewwidgetgroup_R->getCurrentComboBoxPixmap(index);
+        m_veCurrentSelectGroup_R.pSelectGroup->UpDataImageShowSlots(updatePixmap);
+    }
 }

+ 15 - 11
View/die-bonder-ui/OriginalWnd/MainAndSecondaryCamerasWnd.h

@@ -11,14 +11,14 @@
 #include "JOriginalMainWnd.h"
 
 namespace Ui {
-    class MainAndSecondaryCamerasWnd;
+class MainAndSecondaryCamerasWnd;
 }
 
 class MainAndSecondaryCamerasWnd : public JOriginalMainWnd
 {
     Q_OBJECT
 public:
-    explicit MainAndSecondaryCamerasWnd(QWidget* parent = nullptr);
+    explicit MainAndSecondaryCamerasWnd(QWidget *parent = nullptr);
 
     ~MainAndSecondaryCamerasWnd();
     void initFrom();
@@ -33,26 +33,25 @@ public:
      */
     void updateMaterialWidget(int side, int materialWndType, int groupId);
 
-    QStringList getImageslist(const QString& path);
     void initLeftAndRightWidget();
 
     //封装绑定函数
-    void BindImageOrMaterial(int location, int index);
+    void BindImageOrMaterial(int location,int index );
 
     //保存信息
     void saveInfoOfLast();
-    ;
+;
 
 protected:
     void wheelEvent(QWheelEvent* event) override;
 
 
-    void checkSettings(int groupId, int index);
+    void checkSettings(int groupId,int index);
 
 
-    void showEvent(QShowEvent* event) override;
+    void showEvent(QShowEvent *event) override;
 
-    void hideEvent(QHideEvent* event) override;
+    void hideEvent(QHideEvent *event) override;
 
     void timerEvent(QTimerEvent* event) override;
 
@@ -60,6 +59,9 @@ private slots:
     void GetCurrentSelectSlots(int groupId, int nIndex);
     void GetGroupImageShowSignalsTo_L(const QPixmap& imageData);
     void GetGroupImageShowSignalsTo_R(const QPixmap& imageData);
+    void GetGroupComboxChanged(int groupId,int comboxIndex);
+    void HandleComboxchange_L(int index);
+    void HandleComboxchange_R(int index);
 
 private:
     void InitMainCameraBind(CameraBind* pCameraBind) override;
@@ -71,7 +73,7 @@ private:
     void UpdateCameraDisplay3(int iCameraId, JVision::ImageInfo imageData) override;
     void UpdateCameraDisplay4(int iCameraId, JVision::ImageInfo imageData) override;
 
-
+    
 signals:
     void UpDataImageShowSignals0(const QPixmap& imageData);
     void UpDataImageShowSignals1(const QPixmap& imageData);
@@ -89,10 +91,10 @@ private:
 
     /**更新灯光显示
      */
-    void UpdataLightJoystickSwitchPage(int groupId, int index, bool isShow);
+    void UpdataLightJoystickSwitchPage(int groupId, int index,bool isShow);
 
 private:
-    Ui::MainAndSecondaryCamerasWnd* ui;
+    Ui::MainAndSecondaryCamerasWnd *ui;
 
     QPixmap             Left_currentPixmap;
 
@@ -149,6 +151,8 @@ private:
     QMap<int, MaterialBox*>     m_mapMaterialBoxMap;
     QMap<int, Bond*>            m_mapBondMap;
 
+    QMap<int, QList<QPair<QString, QString>>>            m_mapFileListMap;
+
     //OperateMode         Left_currentMode = ModeImage;
 
     //OperateMode         Right_currentMode = ModeImage;

+ 63 - 5
View/die-bonder-ui/OriginalWnd/SingleCameraOperationWnd.cpp

@@ -15,6 +15,7 @@ SingleCameraOperationWnd::SingleCameraOperationWnd(QWidget* parent)
     ui->viewwidgetgroup->resizeSingleUI(true);
     ui->lightJoystickSwitchPage->resizeSingleUI();
     isShow = true;
+    connect(ui->viewwidgetgroup, &ControlOperationPage::send_ComboBox_singal, this, &SingleCameraOperationWnd::HandleComboxchange);
 
     initFrom();
 }
@@ -57,13 +58,19 @@ void SingleCameraOperationWnd::initFrom() {
 
         for (int i = 0; i < numbers.size(); ++i) {
             int num = numbers[i];
-            CameraImageHandler* manager = new CameraImageHandler(num);
+            CameraInfo test;
+            test.iCameraId = i;
+            test.name = ("camera" + QString::number(i)).toStdString();
+            test.eType = MATERIAL_WAFER;
+            CameraImageHandler* manager = new CameraImageHandler(num, test);
             Group* widget = manager->getGroup();
             if (widget != nullptr)
             {
                 CameraConnectUpdateImageFun(i, widget);
                 connect(widget, &Group::sendUpdateGroupState,
                     this, &SingleCameraOperationWnd::checkSettings);
+                connect(widget, &Group::send_ComboBox_singal,
+                    this, &SingleCameraOperationWnd::GetGroupComboxChanged);
                 layout->addWidget(widget);
                 m_allGroup.append(widget);
                 groupMap[num] = widget;
@@ -80,6 +87,9 @@ void SingleCameraOperationWnd::initFrom() {
             if (manager->getBond()) {
                 bondMap.insert(num, manager->getBond());
             }
+            if (!manager->getFileList().isEmpty()) {
+                m_mapFileListMap.insert(num, manager->getFileList());
+            }
 
             delete manager;
         }
@@ -352,7 +362,11 @@ void SingleCameraOperationWnd::initWidget() {
         lastIndex = 1;
         m_veCurrentSelectGroup.isInitialed = true;
         m_veCurrentSelectGroup.pSelectGroup = m_allGroup.at(lastGroupId - 1);
-
+        m_veCurrentSelectGroup.pSelectGroup->initBorderStyle(lastIndex, 1);
+        //初始化下拉框内容同步小窗口索引
+        int currentComboBoxIndex = m_veCurrentSelectGroup.pSelectGroup->getCurrentComboBoxIndex();
+        ui->viewwidgetgroup->setEnableControls(true);
+        ui->viewwidgetgroup->setComboBox(m_mapFileListMap[m_veCurrentSelectGroup.pSelectGroup->m_nGroupId], currentComboBoxIndex);
         BindImageOrMaterial(m_nImageIndex);
 
     }
@@ -360,13 +374,18 @@ void SingleCameraOperationWnd::initWidget() {
     }
     m_veCurrentSelectGroup.isInitialed = true;
     m_veCurrentSelectGroup.pSelectGroup = m_allGroup.at(lastGroupId - 1);
+    m_veCurrentSelectGroup.pSelectGroup->initBorderStyle(lastIndex, 1);
+    //初始化下拉框内容同步小窗口索引
+    int currentComboBoxIndex = m_veCurrentSelectGroup.pSelectGroup->getCurrentComboBoxIndex();
+    ui->viewwidgetgroup->setComboBox(m_mapFileListMap[m_veCurrentSelectGroup.pSelectGroup->m_nGroupId], currentComboBoxIndex);
+    BindImageOrMaterial(m_nImageIndex);
     if (lastIndex == 1) {
-
+        ui->viewwidgetgroup->setEnableControls(true);
         BindImageOrMaterial(m_nImageIndex);
 
     }
     else {
-
+        ui->viewwidgetgroup->setEnableControls(false);
         BindImageOrMaterial(m_nMaterialIndex);
 
     }
@@ -397,11 +416,17 @@ void SingleCameraOperationWnd::GetCurrentSelectSlots(int groupId, int nIndex) {
     if (nIndex == 2) {
         
         BindImageOrMaterial(m_nMaterialIndex);
-
+        ui->viewwidgetgroup->setEnableControls(false);
     }
     else if (nIndex == 1) {
 
+        //更新下拉框内容同步小窗口索引
+        int currentComboBoxIndex = m_veCurrentSelectGroup.pSelectGroup->getCurrentComboBoxIndex();
+        ui->viewwidgetgroup->setEnableControls(true);
+        ui->viewwidgetgroup->setComboBox(m_mapFileListMap[m_veCurrentSelectGroup.pSelectGroup->m_nGroupId], currentComboBoxIndex);
         BindImageOrMaterial(m_nImageIndex);
+        QPixmap pixmap = ui->viewwidgetgroup->getCurrentComboBoxPixmap(currentComboBoxIndex);
+        GetGroupImageShowSignals(pixmap);
     }
 }
 
@@ -432,4 +457,37 @@ void SingleCameraOperationWnd::UpdataLightJoystickSwitchPage(int groupId, bool i
             ui->lightJoystickSwitchPage, &LightJoystickSwitchPage::GetModuleTypeSlots);
 
 
+}
+void SingleCameraOperationWnd::GetGroupComboxChanged(int groupId, int comboxIndex) {
+
+    m_allGroup.at(groupId - 1);
+    if (comboxIndex == 0) {
+        CameraConnectUpdateImageFun(groupId - 1, m_allGroup.at(groupId - 1), false);
+
+    }
+    else {
+        CameraConnectUpdateImageFun(groupId - 1, m_allGroup.at(groupId - 1), true);
+
+    }
+    m_allGroup.at(groupId - 1)->setCurrentCombox(comboxIndex);
+
+    if (groupId == m_veCurrentSelectGroup.pSelectGroup->m_nGroupId && lastIndex == 1) {
+
+        if (comboxIndex != 0) {//图片
+            QPixmap updatePixmap = ui->viewwidgetgroup->getCurrentComboBoxPixmap(comboxIndex);
+            m_veCurrentSelectGroup.pSelectGroup->UpDataImageShowSlots(updatePixmap);
+        }
+    }
+
+}
+
+void SingleCameraOperationWnd::HandleComboxchange(int index) {
+    if (index == 0) {
+        CameraConnectUpdateImageFun(m_veCurrentSelectGroup.pSelectGroup->m_nGroupId - 1, m_allGroup.at(m_veCurrentSelectGroup.pSelectGroup->m_nGroupId - 1), false);
+    }
+    else {
+        CameraConnectUpdateImageFun(m_veCurrentSelectGroup.pSelectGroup->m_nGroupId - 1, m_allGroup.at(m_veCurrentSelectGroup.pSelectGroup->m_nGroupId - 1), true);
+        QPixmap updatePixmap = ui->viewwidgetgroup->getCurrentComboBoxPixmap(index);
+        m_veCurrentSelectGroup.pSelectGroup->UpDataImageShowSlots(updatePixmap);
+    }
 }

+ 3 - 1
View/die-bonder-ui/OriginalWnd/SingleCameraOperationWnd.h

@@ -41,6 +41,7 @@ public:
 public slots: // 确保这里声明了槽函数
 
     QString getImagePathFromIndex(int index);
+    void GetGroupComboxChanged(int groupId, int comboxIndex);
 
     //void on_DatacomboBox_currentIndexChanged(int index);
     void GetGroupImageShowSignals(const QPixmap& imageData);
@@ -51,7 +52,7 @@ protected:
     void hideEvent(QHideEvent* event) override;
 
 private slots:
-
+    void HandleComboxchange(int index);
     void GetCurrentSelectSlots(int groupId, int nIndex);
     QPixmap getCurrentPixmap() const {
         return currentPixmap;
@@ -98,6 +99,7 @@ private:
     QMap<int, Waffle*> waffleMap;
     QMap<int, MaterialBox*> materialBoxMap;
     QMap<int, Bond*> bondMap;
+    QMap<int, QList<QPair<QString, QString>>>            m_mapFileListMap;
     OperateMode currentMode = ModeImage;
     QGraphicsView* currentView = nullptr;
     QPoint mousePos;

+ 37 - 8
View/die-bonder-ui/SBT_en.ts

@@ -323,14 +323,6 @@
 </context>
 <context>
     <name>ImageView</name>
-    <message>
-        <source>���浱ǰ����ͼƬ</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>����</source>
-        <translation type="unfinished"></translation>
-    </message>
     <message>
         <source>����ͼƬ</source>
         <translation type="unfinished"></translation>
@@ -355,6 +347,18 @@
         <source>ͼƬ�ѳɹ����浽��</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>test ruler</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>save picture</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>clear</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>ImageWidget</name>
@@ -831,5 +835,30 @@ production</translation>
         <comment>发送位置</comment>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>move to current location</source>
+        <comment>移动到该位置</comment>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>set Top left point</source>
+        <comment>设为左上点</comment>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>set bottom right point</source>
+        <comment>设为右下点</comment>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>clear the selected area</source>
+        <comment>清除选中区域</comment>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>set area</source>
+        <comment>设置区域</comment>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 </TS>

二进制
View/die-bonder-ui/SBT_zh_CN.qm


+ 37 - 8
View/die-bonder-ui/SBT_zh_CN.ts

@@ -363,14 +363,6 @@
 </context>
 <context>
     <name>ImageView</name>
-    <message>
-        <source>���浱ǰ����ͼƬ</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>����</source>
-        <translation type="unfinished"></translation>
-    </message>
     <message>
         <source>����ͼƬ</source>
         <translation type="unfinished"></translation>
@@ -395,6 +387,18 @@
         <source>ͼƬ�ѳɹ����浽��</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>test ruler</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>save picture</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>clear</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>ImageWidget</name>
@@ -842,5 +846,30 @@ production</source>
         <comment>发送位置</comment>
         <translation>发送位置</translation>
     </message>
+    <message>
+        <source>move to current location</source>
+        <comment>移动到该位置</comment>
+        <translation>移动到该位置</translation>
+    </message>
+    <message>
+        <source>set Top left point</source>
+        <comment>设为左上点</comment>
+        <translation>设为左上点</translation>
+    </message>
+    <message>
+        <source>set bottom right point</source>
+        <comment>设为右下点</comment>
+        <translation>设为右下点</translation>
+    </message>
+    <message>
+        <source>clear the selected area</source>
+        <comment>清除选中区域</comment>
+        <translation>清除选中区域</translation>
+    </message>
+    <message>
+        <source>set area</source>
+        <comment>设置区域</comment>
+        <translation>设置区域</translation>
+    </message>
 </context>
 </TS>

+ 6 - 1
View/die-bonder-ui/SBTdie-bonder-ui.vcxproj

@@ -241,7 +241,12 @@
     <ClCompile Include="Src\common\JMessageTip.cpp" />
     <ClCompile Include="Src\common\JQCommon.cpp" />
     <ClCompile Include="Src\common\JUserAccountsData.cpp" />
-    <ClCompile Include="Src\RewriteControl\ControlOperationPage.cpp" />
+    <ClCompile Include="Src\RewriteControl\ControlOperationPage.cpp">
+      <DynamicSource Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">input</DynamicSource>
+      <QtMocFileName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(Filename).moc</QtMocFileName>
+      <DynamicSource Condition="'$(Configuration)|$(Platform)'=='Release|x64'">input</DynamicSource>
+      <QtMocFileName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(Filename).moc</QtMocFileName>
+    </ClCompile>
     <ClCompile Include="Src\RewriteControl\JoystickPage.cpp" />
     <ClCompile Include="Src\RewriteControl\LightJoystickSwitchPage.cpp" />
     <ClCompile Include="Src\RewriteControl\MsgDlg\CustomMessageDlg.cpp" />

+ 6 - 4
View/die-bonder-ui/SBTdie-bonder-ui.vcxproj.filters

@@ -240,9 +240,6 @@
     <ClCompile Include="Src\RewriteControl\MsgDlg\CustomMessageDlg.cpp">
       <Filter>Source Files\Src\RewriteControl\MsgDlg</Filter>
     </ClCompile>
-    <ClCompile Include="Src\RewriteControl\ControlOperationPage.cpp">
-      <Filter>Source Files\Src\RewriteControl</Filter>
-    </ClCompile>
     <ClCompile Include="Src\common\GlobalUse\JMouseMonitorThread.cpp">
       <Filter>Source Files\Src\common\GlobalUse</Filter>
     </ClCompile>
@@ -264,6 +261,9 @@
     <ClCompile Include="Src\CameraBind.cpp">
       <Filter>Source Files\Src</Filter>
     </ClCompile>
+    <ClCompile Include="Src\RewriteControl\ControlOperationPage.cpp">
+      <Filter>Source Files\Src\RewriteControl</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <QtMoc Include="ImageWidget.h">
@@ -739,7 +739,9 @@
     <None Include="dark.qss" />
     <None Include="dark.qss" />
     <None Include="dark.qss" />
-    <None Include="dark.qss" />
+    <None Include="dark.qss">
+      <Filter>Resource Files</Filter>
+    </None>
     <None Include="dark.qss">
       <Filter>Resource Files</Filter>
     </None>

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

@@ -7,12 +7,12 @@ ControlOperationPage::ControlOperationPage(QWidget* parent)
     , ui(new Ui::ControlOperationPage)
 {
     ui->setupUi(this);
-	m_isEnable = false;
+    m_isEnable = false;
     m_bRuler = false;
 
 
     InitWnd();
-	initForm();
+    initForm();
 }
 
 ControlOperationPage::~ControlOperationPage()
@@ -31,21 +31,21 @@ void ControlOperationPage::updateOperateWidget(const QPixmap& pixmap) {
     layout->setContentsMargins(0, 0, 0, 0);
     layout->addWidget(customView);
     ui->Operatewidget->setLayout(layout);
-    
+
     m_currentPixmap = scaledPixmap;
     m_scaleFactor = 1.0;
     m_previousScaleFactor = 1.0;
     ui->label_Percentage->setText("100%");
 
     m_currentMode = ModeImage;
-	m_currentImageView = customView;
-	applyScale();
+    m_currentImageView = customView;
+    applyScale();
 }
 
 void ControlOperationPage::initImage() {
     clearLayout();
     ImageView* customView = new ImageView(ui->Operatewidget);
-    
+
     QVBoxLayout* layout = new QVBoxLayout(ui->Operatewidget);
     layout->setContentsMargins(0, 0, 0, 0);
     layout->addWidget(customView);
@@ -87,7 +87,7 @@ void ControlOperationPage::on_ZoomUpButton_clicked()
 
 }
 
-void ControlOperationPage::on_ZoomOutButton_clicked() 
+void ControlOperationPage::on_ZoomOutButton_clicked()
 {
     m_mousePos = ui->Operatewidget->geometry().center();
     updateScale(m_scaleFactor * 0.9);
@@ -97,7 +97,7 @@ void ControlOperationPage::on_ZoomOutButton_clicked()
 // 更新缩放比例
 void ControlOperationPage::updateScale(double newScaleFactor)
 {
-    if (newScaleFactor >= 1.0) 
+    if (newScaleFactor >= 1.0)
     {
         m_scaleFactor = newScaleFactor;
     }
@@ -109,7 +109,7 @@ void ControlOperationPage::updateScale(double newScaleFactor)
 }
 
 // 应用缩放
-void ControlOperationPage::applyScale() 
+void ControlOperationPage::applyScale()
 {
     if (m_currentMode == ModeImage && m_currentImageView)
     {
@@ -133,13 +133,13 @@ void ControlOperationPage::applyScale()
 }
 
 void ControlOperationPage::handleDoubleClick() {
-    if (m_currentMode == ModeImage && m_currentImageView) 
+    if (m_currentMode == ModeImage && m_currentImageView)
     {
         QTransform transform;
         transform.scale(1, 1);
         m_currentImageView->setTransform(transform);
     }
-    else if (m_currentMode == ModeView && m_currentView) 
+    else if (m_currentMode == ModeView && m_currentView)
     {
         QTransform transform;
         transform.scale(1, 1);
@@ -200,7 +200,7 @@ void ControlOperationPage::KindsofWidget(kinds kind)
             layout->addWidget(m_materialbox->view);
             m_currentView = m_materialbox->view;
         }
-        
+
     }
     else if (kind == bond_kind)
     {
@@ -246,6 +246,13 @@ void ControlOperationPage::initForm()
 {
     connect(ui->Operatewidget, &ImageWidget::sendDoubleClicksignal, this, &ControlOperationPage::handleDoubleClick);
     ui->Operatewidget->setMouseTracking(true);
+    connect(ui->DataSources, QOverload<int>::of(&QComboBox::currentIndexChanged),
+        this, &ControlOperationPage::on_DataSources_currentIndexChanged);
+}
+
+void ControlOperationPage::on_DataSources_currentIndexChanged(int comboxIndex) {
+
+    send_ComboBox_singal(comboxIndex);
 }
 
 ImageWidget* ControlOperationPage::getOperatewidget()
@@ -260,8 +267,8 @@ void ControlOperationPage::resizeSingleUI(bool bMax /*= false*/)
     //ui->line_2->setGeometry(QRect(826, 20, 1, 953));
     ui->LiveButton->setGeometry(QRect(436, 20, 60, 32));
     ui->horizontalLayout_2->setGeometry(QRect(12, 882, 786, 32));
-    
-    
+
+
     ui->layoutWidget->setGeometry(QRect(10, 882, 790, 31));
     ui->ZoomUpButton->setGeometry(QRect(25, 882, 120, 32));
     ui->ZoomOutButton->setGeometry(QRect(155, 882, 100, 32));
@@ -270,7 +277,7 @@ void ControlOperationPage::resizeSingleUI(bool bMax /*= false*/)
     ui->PenButton->setGeometry(QRect(530, 882, 100, 32));
     // ui->switchJoystickBut
     ui->horizontalLayout->setGeometry(QRect(12, 882, 786, 32));
-    
+
     ui->BackGround->setGeometry(QRect(16, 68, 794, 794));
 
     if (bMax)
@@ -322,7 +329,7 @@ void ControlOperationPage::UpDateCameraBind(CameraBind* pCameraBind)
 
 void ControlOperationPage::setSwitchJoystickButEnable(bool isEnable)
 {
-	ui->switchJoystickBut->setEnabled(isEnable);
+    ui->switchJoystickBut->setEnabled(isEnable);
     if (isEnable == false)
     {
         ResetIdleTimer(false);
@@ -358,7 +365,7 @@ void ControlOperationPage::on_moduleTypeComboBox_currentIndexChanged(int index)
     m_isAdd = true;
     QString strMod = ui->moduleTypeComboBox->itemText(index);
     ui->axisTypeComboBox->clear();
-    for (auto a: m_pCameraBindCopy->m_vecCAxis)
+    for (auto a : m_pCameraBindCopy->m_vecCAxis)
     {
         // 如果2个相等说明当前模组,与轴匹配
         if (strMod == a->GetModuleType().c_str())
@@ -481,10 +488,10 @@ void ControlOperationPage::ResetIdleTimer(bool bStart /*= false*/)
 void ControlOperationPage::InitWnd()
 {
     HideLayout(false);
-    
-  /*  connect(ui->widgetPage, &JoystickPage::PositionChangedSignals, [&](qreal x, qreal y) {
-        ui->showLabel->setText(QString("摇杆位置: (%1, %2)").arg(x, 0, 'f', 2).arg(y, 0, 'f', 2));
-        });*/
+
+    /*  connect(ui->widgetPage, &JoystickPage::PositionChangedSignals, [&](qreal x, qreal y) {
+          ui->showLabel->setText(QString("摇杆位置: (%1, %2)").arg(x, 0, 'f', 2).arg(y, 0, 'f', 2));
+          });*/
 
     this->setMouseTracking(true);
     this->installEventFilter(this);
@@ -511,7 +518,7 @@ void ControlOperationPage::CreateMouseMonitor(bool isStart)
         delete m_pMousethread;
         m_pMousethread = nullptr;
     }
-   
+
 }
 
 void ControlOperationPage::LockMouse(bool islockMouse)
@@ -627,7 +634,7 @@ void ControlOperationPage::setEnableControls(bool enable) {
     else {
         ui->LiveButton->setStyleSheet("background-color: lightgray;");
     }
-    
+
 }
 
 void ControlOperationPage::setBlueBord() {
@@ -638,12 +645,20 @@ void ControlOperationPage::on_RulerButton_clicked()
 {
     if (nullptr == m_currentImageView)
         return;
+
+    m_bRuler = !m_bRuler;
+    if (m_bRuler == true) {
+        ui->RulerButton->setStyleSheet("QPushButton { background-color: #808FFF; }");
+    }
+    else {
+        ui->RulerButton->setStyleSheet("QPushButton { background-color: #CBD0FF; }");
+    }
     if (ui->RulerButton->isChecked()) {
         m_currentImageView->addRuler();
         if (ui->PenButton->isChecked()) {
             ui->PenButton->setChecked(false);
             m_currentImageView->setIsDrawing(false);
-            ui->PenButton->setStyleSheet("QPushButton { background-color: none; }");
+            //ui->PenButton->setStyleSheet("QPushButton { background-color: none; }");
         }
     }
     else {
@@ -655,10 +670,17 @@ void ControlOperationPage::on_PenButton_clicked() {
     if (nullptr == m_currentImageView)
         return;
     m_isEnable = !m_isEnable;
+
+    if (m_isEnable == true) {
+        ui->PenButton->setStyleSheet("QPushButton { background-color: #808FFF; }");
+    }
+    else {
+        ui->PenButton->setStyleSheet("QPushButton { background-color: #CBD0FF; }");
+    }
     if (ui->PenButton->isChecked()) {
         //ui->Operatewidget->setIsDrawing(true);
         m_currentImageView->setIsDrawing(true);
-        ui->PenButton->setStyleSheet("QPushButton { background-color: #808FFF; }");
+        
         if (ui->RulerButton->isChecked()) {
             ui->RulerButton->setChecked(false);
             m_currentImageView->cancelRuler();
@@ -667,7 +689,7 @@ void ControlOperationPage::on_PenButton_clicked() {
     else {
         //ui->Operatewidget->setIsDrawing(false);
         m_currentImageView->setIsDrawing(false);
-        ui->PenButton->setStyleSheet("QPushButton { background-color: none; }");
+        
     }
 }
 
@@ -699,4 +721,26 @@ void ControlOperationPage::SaveNewImage()
     //else {
     //    QMessageBox::information(this, tr("保存成功"), tr("图片已成功保存到:") + filePath);
     //}
+}
+
+void ControlOperationPage::setComboBox(const QList<QPair<QString, QString>> fileList, const int index) {
+    ui->DataSources->clear();
+    // 使用QList批量添加到QComboBox
+    for (const auto& pair : fileList) {
+        ui->DataSources->addItem(pair.first, pair.second);
+    }
+    ui->DataSources->setCurrentIndex(index);
+}
+
+
+
+QPixmap ControlOperationPage::getCurrentComboBoxPixmap(const int index) {
+
+    if (index < 0)
+        return NULL;
+    // 从用户数据中获取完整路径并输出
+    QString imagePath = ui->DataSources->itemData(index).toString();
+    QPixmap pixmap(imagePath);
+    return pixmap;
+
 }

+ 27 - 22
View/die-bonder-ui/Src/RewriteControl/ControlOperationPage.h

@@ -15,20 +15,20 @@
 #include "../CameraBind.h"
 #include "ImageView.h"
 namespace Ui {
-class ControlOperationPage;
+    class ControlOperationPage;
 }
 class ControlOperationPage : public QWidget
 {
     Q_OBJECT
 
 public:
-    enum kinds{
+    enum kinds {
         wafer_kind,
         waffle_kind,
         materialbox_kind,
         bond_kind
     };
-    explicit ControlOperationPage(QWidget *parent = nullptr);
+    explicit ControlOperationPage(QWidget* parent = nullptr);
     ~ControlOperationPage();
 
 public:
@@ -38,26 +38,29 @@ public:
     void clearLayout();
     void updateScale(double newScaleFactor);
     void applyScale();
-    void updateMaterialWidget( kinds materialWndType);
+    void updateMaterialWidget(kinds materialWndType);
     void KindsofWidget(kinds kind);
-    void setWafer(Wafer *wafer);
-    void setWaffle(Waffle *waffle);
-    void setMaterialBox(MaterialBox *materialbox);
-    void setBond(Bond *bond);
+    void setWafer(Wafer* wafer);
+    void setWaffle(Waffle* waffle);
+    void setMaterialBox(MaterialBox* materialbox);
+    void setBond(Bond* bond);
     ImageWidget* getOperatewidget();
     void resizeSingleUI(bool bMax = false);
     void resizeChartsAndCamerasUI();
     qreal getScaleFactorValue();
     void setScaleFactorSize(QPixmap scaledImage);
+    void setComboBox(const QList<QPair<QString, QString>> fileList, const int index);
+    void setEnableControls(bool enable);
 
     /**更新硬件指针
      */
     void UpDateCameraBind(CameraBind* pCameraBind);
     void setSwitchJoystickButEnable(bool isEnable);
 
-    void setEnableControls(bool enable);
     void setBlueBord();
     void initImage();
+    QPixmap  getCurrentComboBoxPixmap(const int index);
+
 private slots:
     void on_ZoomUpButton_clicked();
     void on_ZoomOutButton_clicked();
@@ -68,22 +71,24 @@ private slots:
     //void on_PenButton_clicked();
     void handleDoubleClick();
     void on_switchJoystickBut_clicked();
-    
+
     void on_moduleTypeComboBox_currentIndexChanged(int index);
     void on_axisTypeComboBox_currentIndexChanged(int index);
-	void SaveNewImage();
+    void SaveNewImage();
+    void on_DataSources_currentIndexChanged(int comboxIndex);
 
 signals:
     /**发送轴变化消息
      */
     void SendModuleTypeSignals(const ST_MOVE_AXIS& _module);
+    void send_ComboBox_singal(int index);
 
 private slots:
     /**位置更新
      */
     void MouseMovedSlots(const QPoint& delta);
     void RequestCursorMoveSlots(const QPoint& pos);
-    
+
 
 protected:
     void timerEvent(QTimerEvent* event) override;
@@ -112,24 +117,24 @@ private:
 
     /**更新轴状态
      */
-    void UpdataModuleType(const QString& strMode,int nIndex);
+    void UpdataModuleType(const QString& strMode, int nIndex);
 private:
     template<class T>
     void DeduplicationBox(QComboBox* pCom, const T& veTemp, int nIndex);
 
 private:
-    Ui::ControlOperationPage*   ui;
+    Ui::ControlOperationPage* ui;
     QPixmap                     m_currentPixmap;
     qreal                       m_scaleFactor;
     QPoint                      m_mousePos;
-    OperateMode                 m_currentMode           = ModeImage;
-    QGraphicsView*              m_currentView           = nullptr;
+    OperateMode                 m_currentMode = ModeImage;
+    QGraphicsView* m_currentView = nullptr;
     double                      m_previousScaleFactor;
-    Wafer*                      m_wafer                 = nullptr; // 声明Wafer指针
-    Waffle*                     m_waffle                = nullptr; // 声明Waffle指针
-    MaterialBox*                m_materialbox           = nullptr; // 声明materialbox指针
-    Bond*                       m_bond                  = nullptr;
-    ImageView*                  m_currentImageView      = nullptr;
+    Wafer* m_wafer = nullptr; // 声明Wafer指针
+    Waffle* m_waffle = nullptr; // 声明Waffle指针
+    MaterialBox* m_materialbox = nullptr; // 声明materialbox指针
+    Bond* m_bond = nullptr;
+    ImageView* m_currentImageView = nullptr;
     bool                        m_isEnable;
     bool                        m_bRuler;
     QPoint                      m_pressPos; // 记录鼠标按下位置
@@ -139,7 +144,7 @@ private:
     int                         m_idleTimer = -1;
 
 private:
-    JMouseMonitorThread*        m_pMousethread = nullptr;
+    JMouseMonitorThread* m_pMousethread = nullptr;
 
     bool                        m_bMouseRun = false; // 重复点击
     bool                        m_isUserOnclick = false;