فهرست منبع

修复了双窗口红蓝小框丢失问题然后以及combox更新问题

yun 1 روز پیش
والد
کامیت
0bca2eeb63

+ 2 - 0
View/die-bonder-ui/CameraMaterialGroupWnd/Group.cpp

@@ -607,6 +607,7 @@ void Group::initBorderStyle(int index,int color) {
         else {
             ui->rightBackground->setStyleSheet("border: 2px solid red;");
             m_pCurrentlySelectedGroup = this;
+            m_pLastClickedGroup = this;
         }
  
     }
@@ -618,6 +619,7 @@ void Group::initBorderStyle(int index,int color) {
         else {
             ui->leftBackground->setStyleSheet("border: 2px solid red;");
             m_pCurrentlySelectedGroup = this;
+            m_pLastClickedGroup = this;
         }
     }
     

+ 7 - 3
View/die-bonder-ui/OriginalWnd/ChartsAndCamerasWnd.cpp

@@ -319,6 +319,10 @@ void ChartsAndCamerasWnd::initFrom() {
 
             delete manager;
         }
+        //清理ui->viewwidgetgroup
+        ui->viewwidgetgroup->clearLayout();
+        QPixmap pixmap = ui->viewwidgetgroup->getCurrentComboBoxPixmap(0);
+        GetGroupImageShowSignals(pixmap);
 
         // 设置控件的最小高度和最大宽度
         int minHeight = 162;
@@ -592,6 +596,9 @@ void ChartsAndCamerasWnd::GetCurrentSelectSlots(int groupId, int nIndex) {
     }
     m_veCurrentSelectGroup.pSelectGroup = m_allGroup.at(nOnClickGroupId);
     //判断index是相机还是物料
+    //更新下拉框内容同步小窗口索引
+    int currentComboBoxIndex = m_veCurrentSelectGroup.pSelectGroup->getCurrentComboBoxIndex();
+    ui->viewwidgetgroup->setComboBox(m_mapFileListMap[m_veCurrentSelectGroup.pSelectGroup->m_nGroupId], currentComboBoxIndex);
     if (nIndex == 2) {
         ui->viewwidgetgroup->setEnableControls(false);
         BindImageOrMaterial(m_nMaterialIndex);
@@ -599,10 +606,7 @@ void ChartsAndCamerasWnd::GetCurrentSelectSlots(int groupId, int nIndex) {
     }
     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);

+ 10 - 6
View/die-bonder-ui/OriginalWnd/MainAndSecondaryCamerasWnd.cpp

@@ -145,6 +145,10 @@ void MainAndSecondaryCamerasWnd::InitPage()
             }
             delete manager;
         }
+        //清理ui->viewwidgetgroup_L
+        ui->viewwidgetgroup_L->clearLayout();
+        QPixmap pixmap = ui->viewwidgetgroup_L->getCurrentComboBoxPixmap(0);
+        GetGroupImageShowSignalsTo_L(pixmap);
 
         // 设置控件的最小高度和最大宽度
         int minHeight = 162;
@@ -571,13 +575,13 @@ void MainAndSecondaryCamerasWnd::GetCurrentSelectSlots(int groupId, int nIndex)
     m_veCurrentSelectGroup_L = m_veCurrentSelectGroup_R;
 
     //判断更新前的右窗口的index是相机还是物料
+    int currentLeftComboBoxIndex = m_veCurrentSelectGroup_L.pSelectGroup->getCurrentComboBoxIndex();
+    ui->viewwidgetgroup_L->setComboBox(m_mapFileListMap[m_veCurrentSelectGroup_L.pSelectGroup->m_nGroupId], currentLeftComboBoxIndex);
     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);
         
+        ui->viewwidgetgroup_L->setEnableControls(true);
         BindImageOrMaterial(m_nLastLeft, m_nImageIndex);
         QPixmap pixmap = ui->viewwidgetgroup_L->getCurrentComboBoxPixmap(currentLeftComboBoxIndex);
         GetGroupImageShowSignalsTo_L(pixmap);
@@ -593,16 +597,16 @@ void MainAndSecondaryCamerasWnd::GetCurrentSelectSlots(int groupId, int nIndex)
     //右边更新物料窗口
     m_veCurrentSelectGroup_R.pSelectGroup = m_allGroup.at(nOnClickGroupId);
     //判断当前index是相机还是物料
+    int currentRightComboBoxIndex = m_veCurrentSelectGroup_R.pSelectGroup->getCurrentComboBoxIndex();
+    ui->viewwidgetgroup_R->setComboBox(m_mapFileListMap[m_veCurrentSelectGroup_R.pSelectGroup->m_nGroupId], currentRightComboBoxIndex);
     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);
 
+        ui->viewwidgetgroup_R->setEnableControls(true);
         BindImageOrMaterial(m_nCurrentRight, m_nImageIndex);
         QPixmap pixmap = ui->viewwidgetgroup_R->getCurrentComboBoxPixmap(currentRightComboBoxIndex);
         GetGroupImageShowSignalsTo_R(pixmap);

+ 7 - 3
View/die-bonder-ui/OriginalWnd/SingleCameraOperationWnd.cpp

@@ -109,6 +109,10 @@ void SingleCameraOperationWnd::initFrom() {
 
             delete manager;
         }
+        //清理ui->viewwidgetgroup
+        ui->viewwidgetgroup->clearLayout();
+        QPixmap pixmap = ui->viewwidgetgroup->getCurrentComboBoxPixmap(0);
+        GetGroupImageShowSignals(pixmap);
 
         // 设置控件的最小高度和最大宽度
         int minHeight = 162;
@@ -429,6 +433,9 @@ void SingleCameraOperationWnd::GetCurrentSelectSlots(int groupId, int nIndex) {
     }
     m_veCurrentSelectGroup.pSelectGroup = m_allGroup.at(nOnClickGroupId);
     //判断index是相机还是物料
+    //更新下拉框内容同步小窗口索引
+    int currentComboBoxIndex = m_veCurrentSelectGroup.pSelectGroup->getCurrentComboBoxIndex();
+    ui->viewwidgetgroup->setComboBox(m_mapFileListMap[m_veCurrentSelectGroup.pSelectGroup->m_nGroupId], currentComboBoxIndex);
     if (nIndex == 2) {
         
         BindImageOrMaterial(m_nMaterialIndex);
@@ -436,10 +443,7 @@ void SingleCameraOperationWnd::GetCurrentSelectSlots(int groupId, int nIndex) {
     }
     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);