Quellcode durchsuchen

更新代码:相机同步缩放和放大拖动以及物料和相机的整合

yun vor 4 Tagen
Ursprung
Commit
a6c43a68d7

+ 2 - 1
View/die-bonder-ui/CameraMaterialGroupWnd/CameraImage/CameraImageHandler.cpp

@@ -118,7 +118,7 @@ void CameraImageHandler::initGroup(int CameraId) {
     else if (CameraId == 3) 
     {
         MaterialWindowType = 3;
-        waffle = new Waffle(0);
+        materialBox = new MaterialBox(0);
         m_pGroup = new Group(CameraId, ":/images/test_image/image_5.png", MaterialWindowType, dispmodel3, this);
     } 
     else if (CameraId == 4) 
@@ -142,6 +142,7 @@ void CameraImageHandler::initGroup(int CameraId) {
     else if (CameraId == 7)
     {
         MaterialWindowType = 3;
+		materialBox = new MaterialBox(0);
         m_pGroup = new Group(CameraId, ":/images/test_image/image_5.png", MaterialWindowType, dispmodel3, this);
     } 
     else if (CameraId == 8)

+ 24 - 8
View/die-bonder-ui/CameraMaterialGroupWnd/Group.cpp

@@ -98,27 +98,43 @@ bool Group::eventFilter(QObject *obj, QEvent *event)
         QMouseEvent* mouseEvent = static_cast<QMouseEvent*>(event);
         if (mouseEvent->button() == Qt::LeftButton)
         {
-            int groupId = obj->property("groupId").toInt();
-            QSettings settings("YourCompany", "YourApplication_");
-            settings.setValue("GroupId", groupId);
+
             int index = 0;
             if (obj == this->ui->Imagewidget_left) 
             {
                 index = 1;
-                settings.setValue("Index", 1);
-                check_selected(1);
                 setEnableControls(true);
             } 
             else if (obj == this->ui->Imagewidget_right)
             {
                 index = 2;
-                settings.setValue("Index", 2);
-                check_selected(2);
                 setEnableControls(false);
             }
+            if (index == 0) {
+                return QWidget::eventFilter(obj, event);
+            }
+            //获取当前点击的group
+            int groupId = obj->property("groupId").toInt();
+
+            QSettings lastSettings("YourCompany", "YourApplication_");
+            int lastGroupId = lastSettings.value("GroupId", 0).toInt();
+            int lastIndex = lastSettings.value("Index", 0).toInt();
+            //对比判断点击是否当前的最新小窗口
+            if ((lastGroupId == groupId) && (lastIndex == index)) {
+                return QWidget::eventFilter(obj, event);
+            }
+            // 保存索引并调用检查函数
+            
+            QSettings settings("YourCompany", "YourApplication_");
+            settings.setValue("GroupId", groupId);
+            settings.setValue("Index", index);
+
+            //改变小窗口边框颜色
+            check_selected(index);
+            //发送信号
             emit SetCurrentSelectSig(groupId, index);
             emit SendGroupSelectedSignals(this, index);
-            emit sendUpdateGroupState();
+            emit sendUpdateGroupState(groupId, index);
             return true;
         }
     }

+ 1 - 1
View/die-bonder-ui/CameraMaterialGroupWnd/Group.h

@@ -36,7 +36,7 @@ signals:
     void send_button_Signal();
     void send_ComboBox_singal(int groupId,int index);
     void SendGroupSelectedSignals(Group* group, int index);
-    void sendUpdateGroupState();
+    void sendUpdateGroupState(int groupId,int index);
 
     /**当前选中了哪一个
      */

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

@@ -216,7 +216,7 @@ void ChartsAndCamerasWnd::on_CheckBox_clicked()
 #endif
 
 void ChartsAndCamerasWnd::initFrom() {
-    checkSettings();
+    // checkSettings();
 
    
     QWidget *viewport = ui->scrollArea->viewport();
@@ -276,15 +276,15 @@ void ChartsAndCamerasWnd::initFrom() {
     container->setLayout(layout);
     ui->scrollArea->setWidget(container);
     ui->scrollArea->resize(508, 177);
-    checkSettings();
+    // checkSettings();
 
 }
 
 
-void ChartsAndCamerasWnd::checkSettings() {
-    QSettings settings("YourCompany", "YourApplication_");
-    int groupId = settings.value("GroupId", 0).toInt();
-    int index = settings.value("Index", 0).toInt();
+void ChartsAndCamerasWnd::checkSettings(int groupId,int index) {
+    //QSettings settings("YourCompany", "YourApplication_");
+    //int groupId = settings.value("GroupId", 0).toInt();
+    //int index = settings.value("Index", 0).toInt();
 
     if (groupId != lastGroupId || index != lastIndex) {
         lastGroupId = groupId;

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

@@ -30,7 +30,7 @@ public:
 protected:
     void wheelEvent(QWheelEvent *event) override;
     void loadSettings();
-    void checkSettings();
+    void checkSettings(int groupId,int index);
     void loadGroupSettings(int Id, int Index);
     void showEvent(QShowEvent *event) override;
     void hideEvent(QHideEvent *event) override;

+ 202 - 111
View/die-bonder-ui/OriginalWnd/MainAndSecondaryCamerasWnd.cpp

@@ -72,36 +72,7 @@ void MainAndSecondaryCamerasWnd::initFrom()
     //ui->LeftOperatewidget->setMouseTracking(true);
     //ui->RightOperatewidget->setMouseTracking(true);
 
-    QSettings settings2("YourOrganization", "YourApplication_lastWndType");
-    int lastWndType = settings2.value("LastWndType").toInt();
-    int LastGroup = settings2.value("LastGroup").toInt();
-    lastIndex = lastWndType;
-    lastGroupId = LastGroup;
 
-    QSettings settings("YourCompany", "YourApplication_");
-    int groupId = settings.value("GroupId", 0).toInt();
-    int index = settings.value("Index", 0).toInt();
-
-    QSettings lastSettings("YourOrganization", "YourApplication");
-    lastSettings.beginGroup("LastSettings");
-    lastLastIndex = lastSettings.value("LastLastIndex", 0).toInt();
-    lastLastGroupId = lastSettings.value("LastLastGroupId", 0).toInt();
-
-    if (m_allGroup.size() == 1) {
-        if (lastGroupId == lastLastGroupId) {
-            GetCurrentSelectSlots(lastLastGroupId, lastLastIndex);
-            GetCurrentSelectSlots(lastGroupId, lastIndex);
-        }
-        else {
-            GetCurrentSelectSlots(lastGroupId, lastIndex);
-        }
-    }
-    else {
-        lastLastGroupId = lastLastIndex = 1; //TODO: 需要修改
-        GetCurrentSelectSlots(lastLastGroupId, lastLastIndex);
-        GetCurrentSelectSlots(lastGroupId, lastIndex);
-    }
-    checkSettings();
 
 }
 
@@ -148,7 +119,7 @@ void MainAndSecondaryCamerasWnd::InitPage()
             {
                 m_mapWaferMap.insert(num, manager->getWafer());
             }
-            if (manager->getWafer()) {
+            if (manager->getWaffle()) {
                 m_mapWaffleMap.insert(num, manager->getWaffle());
             }
             if (manager->getMaterialBox()) {
@@ -166,9 +137,9 @@ void MainAndSecondaryCamerasWnd::InitPage()
         int num = -28;
         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);
@@ -176,6 +147,8 @@ void MainAndSecondaryCamerasWnd::InitPage()
         ui->scrollArea->setWidget(container);
         ui->scrollArea->resize(1062, 177);
 
+        initLeftAndRightWidget();
+
 
         //// 只有一个相机的情况,直接绑定
         //if (numbers.size() == 1)
@@ -194,23 +167,23 @@ void MainAndSecondaryCamerasWnd::InitPage()
 
         //    UpdataLightJoystickSwitchPage();
         //}
-    } 
+    }
 }
 
 void MainAndSecondaryCamerasWnd::CameraConnectUpdateImageFun(int nIndex, Group* widget, bool isUnCameraBind /*= false*/)
-{    
+{
     auto BinCamerasImage = [&](void (MainAndSecondaryCamerasWnd::* pCamerasImage)(const QPixmap& imageData))
     {
         if (isUnCameraBind)
         {
-           disconnect(widget, &Group::SetCurrentSelectSig, this, &MainAndSecondaryCamerasWnd::GetCurrentSelectSlots);
-           disconnect(this, pCamerasImage, widget, &Group::UpDataImageShowSlots);
+            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(widget, &Group::SetCurrentSelectSig, this, &MainAndSecondaryCamerasWnd::GetCurrentSelectSlots);
             connect(this, pCamerasImage, widget, &Group::UpDataImageShowSlots);
         }
 
@@ -218,7 +191,7 @@ void MainAndSecondaryCamerasWnd::CameraConnectUpdateImageFun(int nIndex, Group*
 
     if (nIndex == 0)
     {
-        BinCamerasImage(&MainAndSecondaryCamerasWnd::UpDataImageShowSignals0);  
+        BinCamerasImage(&MainAndSecondaryCamerasWnd::UpDataImageShowSignals0);
     }
     else if (nIndex == 1)
     {
@@ -238,24 +211,154 @@ void MainAndSecondaryCamerasWnd::CameraConnectUpdateImageFun(int nIndex, Group*
     }
 }
 
-void MainAndSecondaryCamerasWnd::checkSettings() {
-    QSettings settings("YourCompany", "YourApplication_");
-    int groupId = settings.value("GroupId", 0).toInt();
-    int index = settings.value("Index", 0).toInt();
+
+void MainAndSecondaryCamerasWnd::initLeftAndRightWidget() {
+
+    
+    //初始化当前页面的信息
+    QSettings settings("YourOrganization", "YourApplication");
+    settings.beginGroup("LastSettings");
+    m_lastRightPixmap = settings.value("LastRightPixmap").value<QPixmap>();
+    lasttextList = settings.value("LasttextList").toStringList();
+    lastLastRightPixmap = settings.value("LastLastRightPixmap").value<QPixmap>();
+    lastLasttextList = settings.value("LastLasttextList").toStringList();
+    int lastLast_materialWndType = settings.value("MaterialWndType").toInt();
+    lastLastIndex = settings.value("LastLastIndex", 0).toInt();
+    lastLastGroupId = settings.value("LastLastGroupId", 0).toInt();
+    settings.endGroup();
+
+    QSettings settings2("YourOrganization", "YourApplication_lastWndType");
+    int lastWndType = settings2.value("LastWndType").toInt();
+    int LastGroup = settings2.value("LastGroup").toInt();
+    int Last_materialWndType = settings2.value("MaterialWndType").toInt();
+    lastIndex = lastWndType;
+    lastGroupId = LastGroup;
+
+    //处理各种情况的初始化
+    if (m_pMainCameraBind == nullptr || m_allGroup.size() < lastGroupId || m_allGroup.size() == 0)
+    {
+        return;
+    }
+
+    if (m_allGroup.size() == 1) {
+        if (LastGroup != lastLastGroupId || LastGroup == lastLastGroupId){
+            m_veCurrentSelectGroup_R.isInitialed = true;
+            m_veCurrentSelectGroup_L.isInitialed = true;
+            m_veCurrentSelectGroup_L.pSelectGroup = m_allGroup.at(lastGroupId - 1);
+            m_veCurrentSelectGroup_R.pSelectGroup = m_allGroup.at(lastGroupId - 1);
+            
+            if (lastIndex == 1) {
+                BindImageOrMaterial(m_nCurrentRight, m_nImageIndex);
+                BindImageOrMaterial(m_nLastLeft, m_nMaterialIndex);
+            }
+            else {
+                BindImageOrMaterial(m_nCurrentRight, m_nMaterialIndex);
+                BindImageOrMaterial(m_nLastLeft, m_nImageIndex);
+
+            }
+
+        }else {
+
+        }
+    }else {
+    }
+        m_veCurrentSelectGroup_R.isInitialed = true;
+        m_veCurrentSelectGroup_L.isInitialed = true;
+        m_veCurrentSelectGroup_L.pSelectGroup = m_allGroup.at(lastLastGroupId - 1);
+        m_veCurrentSelectGroup_R.pSelectGroup = m_allGroup.at(lastGroupId -1);
+        if (lastLastIndex == 1) {
+
+            BindImageOrMaterial(m_nLastLeft, m_nImageIndex);
+
+        }
+        else {
+
+            BindImageOrMaterial(m_nLastLeft, m_nMaterialIndex);
+
+        }
+
+        if (lastIndex == 1) {
+            BindImageOrMaterial(m_nCurrentRight, m_nImageIndex);
+
+        }
+        else {
+            BindImageOrMaterial(m_nCurrentRight, m_nMaterialIndex);
+            m_veCurrentSelectGroup_R.isBond = false;
+            UpdataLightJoystickSwitchPage(m_veCurrentSelectGroup_R.pSelectGroup->m_nGroupId, 2, false);
+            
+        }
+
+    
+}
+
+void MainAndSecondaryCamerasWnd::BindImageOrMaterial(int location, int index) {
+    if (location == m_nLastLeft) {
+        if (index == m_nImageIndex) {
+
+            m_veCurrentSelectGroup_L.isBond = true;
+            connect(m_veCurrentSelectGroup_L.pSelectGroup, &Group::SetUpDataImageShowSig,
+                this, &MainAndSecondaryCamerasWnd::GetGroupImageShowSignalsTo_L);
+            UpdataLightJoystickSwitchPage(m_veCurrentSelectGroup_L.pSelectGroup->m_nGroupId, 1, true);
+
+        }else {
+            //左边更新物料窗口
+            QSettings settings("YourOrganization", "YourApplication");
+            settings.beginGroup(QString::number(m_veCurrentSelectGroup_L.pSelectGroup->m_nGroupId));
+            int lastMaterialWndType = settings.value("MaterialWndType").toInt();
+            settings.endGroup();
+            m_veCurrentSelectGroup_L.isBond = false;
+            UpdataLightJoystickSwitchPage(m_veCurrentSelectGroup_L.pSelectGroup->m_nGroupId, 1, false);
+            updateMaterialWidget(m_nLastLeft, lastMaterialWndType, m_veCurrentSelectGroup_L.pSelectGroup->m_nGroupId);
+
+        }
+    }else {
+        if (index == m_nImageIndex) {
+
+            m_veCurrentSelectGroup_R.isBond = true;
+            connect(m_veCurrentSelectGroup_R.pSelectGroup, &Group::SetUpDataImageShowSig,
+                this, &MainAndSecondaryCamerasWnd::GetGroupImageShowSignalsTo_R);
+            UpdataLightJoystickSwitchPage(m_veCurrentSelectGroup_R.pSelectGroup->m_nGroupId, 2, true);
+
+        }
+        else {
+            //右边更新物料窗口
+            QSettings settings("YourOrganization", "YourApplication");
+            settings.beginGroup(QString::number(m_veCurrentSelectGroup_R.pSelectGroup->m_nGroupId));
+            int materialWndType = settings.value("MaterialWndType").toInt();
+            settings.endGroup();
+            m_veCurrentSelectGroup_R.isBond = false;
+            UpdataLightJoystickSwitchPage(m_veCurrentSelectGroup_R.pSelectGroup->m_nGroupId, 2, false);
+            updateMaterialWidget(m_nCurrentRight, materialWndType, m_veCurrentSelectGroup_R.pSelectGroup->m_nGroupId);
+
+        }
+
+    }
+}
+
+void MainAndSecondaryCamerasWnd::checkSettings(int groupId,int index) {
+
 
     if (groupId != lastGroupId || index != lastIndex) {
-        loadSettings();
+        GetCurrentSelectSlots(groupId, index);
+        lastLastGroupId = lastGroupId;
+        lastLastIndex = lastIndex;
         lastGroupId = groupId;
         lastIndex = index;
+        saveInfoOfLast();
+
     }
 }
 
-void MainAndSecondaryCamerasWnd::loadSettings()
-{
-    QSettings settings("YourCompany", "YourApplication_");
-    int groupId = settings.value("GroupId", 0).toInt();
-    int index = settings.value("Index", 0).toInt();
-    loadGroupSettings(groupId, index);
+void MainAndSecondaryCamerasWnd::saveInfoOfLast() {
+
+    QSettings lastSettings("YourOrganization", "YourApplication_lastWndType");
+    lastSettings.setValue("LastWndType", lastIndex);
+    lastSettings.setValue("LastGroup", lastGroupId);
+    QSettings settings("YourOrganization", "YourApplication");
+    settings.beginGroup("LastSettings");
+    settings.setValue("LastLastIndex", lastLastIndex);
+    settings.setValue("LastLastGroupId", lastLastGroupId);
+
 }
 
 void MainAndSecondaryCamerasWnd::loadGroupSettings(int Id, int Index)
@@ -447,7 +550,7 @@ void MainAndSecondaryCamerasWnd::UpdataLightJoystickSwitchPage(int groupId, int
     {
         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);
@@ -456,7 +559,7 @@ void MainAndSecondaryCamerasWnd::UpdataLightJoystickSwitchPage(int groupId, int
     {
         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);
@@ -471,84 +574,72 @@ void MainAndSecondaryCamerasWnd::timerEvent(QTimerEvent* event)
 
 void MainAndSecondaryCamerasWnd::GetCurrentSelectSlots(int groupId, int nIndex)
 {
-    int nOnClickGroupId = groupId - 1; // 这里new 有些是0,有些是1 暂时选择
-    if (m_pMainCameraBind == nullptr || m_allGroup.size() < nOnClickGroupId)
+    int nOnClickGroupId = groupId -1; // 这里new 有些是0,有些是1 暂时选择
+    if (m_pMainCameraBind == nullptr || m_allGroup.size() < groupId)
     {
         return;
     }
 
-    if (nIndex == 2)
-    {
-        if (m_veCurrentSelectGroup_R.isBond == true)
-        {
-            m_veCurrentSelectGroup_R.isBond = false;
-            UpdataLightJoystickSwitchPage(m_veCurrentSelectGroup_R.pSelectGroup->m_nGroupId, 2, false);
-            m_veCurrentSelectGroup_L = m_veCurrentSelectGroup_R;
-            m_veCurrentSelectGroup_L.isBond = true;
+    //判断index是相机还是物料
+    if (nIndex == 2) {
+
+        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);
 
-            //换绑
-            connect(m_veCurrentSelectGroup_L.pSelectGroup, &Group::SetUpDataImageShowSig,
-                this, &MainAndSecondaryCamerasWnd::GetGroupImageShowSignalsTo_L);
-            UpdataLightJoystickSwitchPage(m_veCurrentSelectGroup_L.pSelectGroup->m_nGroupId, 1, true);
+
+            //左窗口绑定
+            m_veCurrentSelectGroup_L = m_veCurrentSelectGroup_R;
+            BindImageOrMaterial(m_nLastLeft, m_nImageIndex);
+
         }
-        else
-        {
-            if (m_veCurrentSelectGroup_R.isInitialed == true)
-            {
-                m_veCurrentSelectGroup_L = m_veCurrentSelectGroup_R;
-                m_veCurrentSelectGroup_L.isBond = false;
-                UpdataLightJoystickSwitchPage(m_veCurrentSelectGroup_L.pSelectGroup->m_nGroupId, 1, false);
-            }
-            Group* pGroup = m_allGroup.at(nOnClickGroupId);
-            m_veCurrentSelectGroup_R.isInitialed = true;
-            m_veCurrentSelectGroup_R.pSelectGroup = pGroup;
-            UpdataLightJoystickSwitchPage(m_veCurrentSelectGroup_R.pSelectGroup->m_nGroupId, 2, false);
+        else {
+
+            BindImageOrMaterial(m_nLastLeft, m_nMaterialIndex);
+
         }
-    }
-    else
-    {
-        if (m_veCurrentSelectGroup_R.isBond == true)
-        {
+        //右边更新物料窗口
+        m_veCurrentSelectGroup_R.pSelectGroup = m_allGroup.at(nOnClickGroupId);
+        BindImageOrMaterial(m_nCurrentRight, m_nMaterialIndex);
+
+    }else if (nIndex == 1) {//当前切换时相机序号
+        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);
             m_veCurrentSelectGroup_L = m_veCurrentSelectGroup_R;
+
             //换绑
-            connect(m_veCurrentSelectGroup_L.pSelectGroup, &Group::SetUpDataImageShowSig,
-                this, &MainAndSecondaryCamerasWnd::GetGroupImageShowSignalsTo_L);
-            UpdataLightJoystickSwitchPage(m_veCurrentSelectGroup_L.pSelectGroup->m_nGroupId, 1, true);
-            Group* pGroup = m_allGroup.at(nOnClickGroupId);
-            m_veCurrentSelectGroup_R.pSelectGroup = pGroup;
-            m_veCurrentSelectGroup_R.isBond = true;
-            m_veCurrentSelectGroup_R.isInitialed = true;
-            connect(m_veCurrentSelectGroup_R.pSelectGroup, &Group::SetUpDataImageShowSig,
-                this, &MainAndSecondaryCamerasWnd::GetGroupImageShowSignalsTo_R);
-            UpdataLightJoystickSwitchPage(m_veCurrentSelectGroup_R.pSelectGroup->m_nGroupId, 2, true);
+            //左窗口绑定
+            m_veCurrentSelectGroup_L = m_veCurrentSelectGroup_R;
+            BindImageOrMaterial(m_nLastLeft, m_nImageIndex);
 
         }
-        else
-        {
-            if (m_veCurrentSelectGroup_R.isInitialed == true)
-            {
-                if (m_veCurrentSelectGroup_L.isBond == true) {
-                    disconnect(m_veCurrentSelectGroup_L.pSelectGroup, &Group::SetUpDataImageShowSig,
-                        this, &MainAndSecondaryCamerasWnd::GetGroupImageShowSignalsTo_L);
-                }
-                m_veCurrentSelectGroup_L = m_veCurrentSelectGroup_R;
-                UpdataLightJoystickSwitchPage(m_veCurrentSelectGroup_L.pSelectGroup->m_nGroupId, 1, false);
-            }
+        else {
+
+            //左边更新物料窗口
+            m_veCurrentSelectGroup_L = m_veCurrentSelectGroup_R;
+            QSettings settings("YourOrganization", "YourApplication");
+            settings.beginGroup(QString::number(m_veCurrentSelectGroup_L.pSelectGroup->m_nGroupId));
+            int lastMaterialWndType = settings.value("MaterialWndType").toInt();
+            settings.endGroup();
+            BindImageOrMaterial(m_nLastLeft, m_nMaterialIndex);
 
-            Group* pGroup = m_allGroup.at(nOnClickGroupId);
-            m_veCurrentSelectGroup_R.pSelectGroup = pGroup;
-            m_veCurrentSelectGroup_R.isBond = true;
-            m_veCurrentSelectGroup_R.isInitialed = true;
-            connect(m_veCurrentSelectGroup_R.pSelectGroup, &Group::SetUpDataImageShowSig,
-                this, &MainAndSecondaryCamerasWnd::GetGroupImageShowSignalsTo_R);
-            UpdataLightJoystickSwitchPage(m_veCurrentSelectGroup_R.pSelectGroup->m_nGroupId, 2, true);
         }
+        //右窗口更新相机窗口
+        m_veCurrentSelectGroup_R.pSelectGroup = m_allGroup.at(nOnClickGroupId);
+        BindImageOrMaterial(m_nCurrentRight, m_nImageIndex);
+
     }
 }
 

+ 12 - 2
View/die-bonder-ui/OriginalWnd/MainAndSecondaryCamerasWnd.h

@@ -34,13 +34,20 @@ public:
     void updateMaterialWidget(int side, int materialWndType, int groupId);
 
     QStringList getImageslist(const QString& path);
+    void initLeftAndRightWidget();
+
+    //封装绑定函数
+    void BindImageOrMaterial(int location,int index );
+
+    //保存信息
+    void saveInfoOfLast();
+;
 
 protected:
     void wheelEvent(QWheelEvent* event) override;
 
-    void loadSettings();
 
-    void checkSettings();
+    void checkSettings(int groupId,int index);
 
     // void loadGroupSettings(int Id, int Index);
     /**更新刷新
@@ -163,6 +170,9 @@ private:
     //TODO: 干啥用的?
     const int           m_nLastLeft = 0;
     const int           m_nCurrentRight = 1;
+    const int           m_nImageIndex = 1;
+    const int           m_nMaterialIndex = 2;
+
 };
 
 #endif // MAINANDSECONDARYCAMERASWND_H

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

@@ -80,7 +80,7 @@ void SingleCameraOperationWnd::initFrom() {
     container->setLayout(layout);
     ui->scrollArea->setWidget(container);
     ui->scrollArea->resize(261, 700);
-    checkSettings();
+    //checkSettings(int groupId,int index);
 
 
 }
@@ -96,10 +96,10 @@ void SingleCameraOperationWnd::closeEvent(QCloseEvent *event) {
 
 
 
-void SingleCameraOperationWnd::checkSettings() {
-    QSettings settings("YourCompany", "YourApplication_");
-    int groupId = settings.value("GroupId", 0).toInt();
-    int index = settings.value("Index", 0).toInt();
+void SingleCameraOperationWnd::checkSettings(int groupId,int index) {
+    //QSettings settings("YourCompany", "YourApplication_");
+    //int groupId = settings.value("GroupId", 0).toInt();
+    //int index = settings.value("Index", 0).toInt();
 
     if (groupId != lastGroupId || index != lastIndex) {
         lastGroupId = groupId;

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

@@ -43,7 +43,7 @@ public slots: // 确保这里声明了槽函数
 protected:
     void wheelEvent(QWheelEvent *event) override;
     void loadSettings();
-    void checkSettings();
+    void checkSettings(int groupId,int index);
     void showEvent(QShowEvent *event) override;
     void hideEvent(QHideEvent *event) override;
 

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

@@ -36,7 +36,7 @@ void ControlOperationPage::updateOperateWidget(const QPixmap& pixmap) {
     m_previousScaleFactor = 1.0;
     ui->label_Percentage->setText("100%");
 
-    //m_currentMode = ModeImage;
+    m_currentMode = ModeImage;
 	m_currentImageView = customView;
 	applyScale();
 }

BIN
新功能需求完成情况4.14.xls