Browse Source

修复物料刷新之后重置位置大小的问题,但是还是会受到刷新的影响抖动

yun 1 tuần trước cách đây
mục cha
commit
a6999ee1c6

+ 2 - 2
View/die-bonder-ui/CameraMaterialGroupWnd/MaterialWindow/Bond.cpp

@@ -252,8 +252,8 @@ void Bond::initFrom(QWidget* parent) {
         ratio = maxWidth / (width - 100);
     }
     //目前没提供pt固晶点大小,以下用测试大小,后续可替换(实际大小,接口替换处)
-    double dieWidth = 20000;
-    double dieHeight = 20000;
+    double dieWidth = 1000;
+    double dieHeight = 1000;
 
     QFont matrixFont;
     double matrixFontSize = qMin(dieWidth/ratio, dieHeight / ratio)*0.1;

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

@@ -317,13 +317,13 @@ void ChartsAndCamerasWnd::initFrom()
             if (manager->getWafer())
             {
                 waferMap.insert(num, manager->getWafer());
-                ui->viewwidgetgroup->setWafer(waferMap.value(i + 1));
+                ui->viewwidgetgroup->setWafer(waferMap.value(i + 1), true);
                 m_allGroup[i]->setWaferWidget(ui->viewwidgetgroup->getWafer()->getGlobalPixmap());
             }
             if (manager->getWaffle())
             {
                 waffleMap.insert(num, manager->getWaffle());
-                ui->viewwidgetgroup->setWaffle(waffleMap.value(i + 1));
+                ui->viewwidgetgroup->setWaffle(waffleMap.value(i + 1), true);
                 m_allGroup[i]->setWaffleWidget(ui->viewwidgetgroup->getWaffle()->getGlobalPixmap());
             }
             if (manager->getMaterialBox())
@@ -332,7 +332,7 @@ void ChartsAndCamerasWnd::initFrom()
             }
             if (manager->getBond()) {
                 bondMap.insert(num, manager->getBond());
-                ui->viewwidgetgroup->setBond(bondMap.value(i + 1));
+                ui->viewwidgetgroup->setBond(bondMap.value(i + 1),true);
                 m_allGroup[i]->setBondWidget(ui->viewwidgetgroup->getBond()->getGlobalPixmap());
             }
             if (!manager->getFileList().isEmpty()) {
@@ -384,10 +384,10 @@ void ChartsAndCamerasWnd::checkSettings(int groupId, int index) {
 void ChartsAndCamerasWnd::updateMaterialWidget(int materialWndType, int groupId) {
 
     switch (materialWndType) {
-    case 1: ui->viewwidgetgroup->setWafer(waferMap.value(groupId)); break;
-    case 2: ui->viewwidgetgroup->setWaffle(waffleMap.value(groupId)); break;
-    case 3: ui->viewwidgetgroup->setMaterialBox(materialBoxMap.value(groupId)); break;
-    case 4: ui->viewwidgetgroup->setBond(bondMap.value(groupId)); break;
+    case 1: ui->viewwidgetgroup->setWafer(waferMap.value(groupId), true); break;
+    case 2: ui->viewwidgetgroup->setWaffle(waffleMap.value(groupId), true); break;
+    case 3: ui->viewwidgetgroup->setMaterialBox(materialBoxMap.value(groupId), true); break;
+    case 4: ui->viewwidgetgroup->setBond(bondMap.value(groupId),true); break;
     }
 
 }
@@ -714,28 +714,28 @@ void ChartsAndCamerasWnd::UpdateMaterialByTimer() {
         case 1:
         {
             UpdateWafer(lastGroupId);
-            ui->viewwidgetgroup->setWafer(waferMap.value(lastGroupId));
+            ui->viewwidgetgroup->setWafer(waferMap.value(lastGroupId), false);
             m_allGroup[lastGroupId - 1]->setWaferWidget(ui->viewwidgetgroup->getWafer()->getGlobalPixmap());
             break;
         }
         case 2:
         {
             UpdateWaffle(lastGroupId);
-            ui->viewwidgetgroup->setWaffle(waffleMap.value(lastGroupId));
+            ui->viewwidgetgroup->setWaffle(waffleMap.value(lastGroupId), false);
             m_allGroup[lastGroupId - 1]->setWaffleWidget(ui->viewwidgetgroup->getWaffle()->getGlobalPixmap());
             break;
         }
         case 3:
         {
             UpdateMaterialBox(lastGroupId);
-            ui->viewwidgetgroup->setMaterialBox(materialBoxMap.value(lastGroupId));
+            ui->viewwidgetgroup->setMaterialBox(materialBoxMap.value(lastGroupId), false);
             m_allGroup[lastGroupId - 1]->MaterialBoxWidget();
             break;
         }
         case 4:
         {
             UpdateBond(lastGroupId);
-            ui->viewwidgetgroup->setBond(bondMap.value(lastGroupId));
+            ui->viewwidgetgroup->setBond(bondMap.value(lastGroupId),false);
             m_allGroup[lastGroupId - 1]->setBondWidget(ui->viewwidgetgroup->getBond()->getGlobalPixmap());
             break;
         }

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

@@ -30,7 +30,7 @@ MainAndSecondaryCamerasWnd::MainAndSecondaryCamerasWnd(QWidget* parent)
     m_veCurrentSelectGroup_R.isBond = false;
     m_veCurrentSelectGroup_L.isBond = false;
     m_timerMaterial = new QTimer(this);
-    //connect(m_timerMaterial, &QTimer::timeout, this, &MainAndSecondaryCamerasWnd::UpdateMaterialByTimer);
+    connect(m_timerMaterial, &QTimer::timeout, this, &MainAndSecondaryCamerasWnd::UpdateMaterialByTimer);
     m_pCViewInterface = ns_module::CViewInterface::GetInstance();
 }
 
@@ -113,7 +113,7 @@ void MainAndSecondaryCamerasWnd::InitPage()
             }
             else
             {
-                m_pMainCameraBind->m_vecCamera[i].eType = MATERIAL_WAFER;
+                m_pMainCameraBind->m_vecCamera[i].eType = MATERIAL_BOND;
                 manager = new CameraImageHandler(num, m_pMainCameraBind->m_vecCamera[i]);
             }
 
@@ -137,12 +137,12 @@ void MainAndSecondaryCamerasWnd::InitPage()
             if (manager->getWafer())
             {
                 m_mapWaferMap.insert(num, manager->getWafer());
-                ui->viewwidgetgroup_L->setWafer(m_mapWaferMap.value(i + 1));
+                ui->viewwidgetgroup_L->setWafer(m_mapWaferMap.value(i + 1), true);
                 m_allGroup[i]->setWaferWidget(ui->viewwidgetgroup_L->getWafer()->getGlobalPixmap());
             }
             if (manager->getWaffle()) {
                 m_mapWaffleMap.insert(num, manager->getWaffle());
-                ui->viewwidgetgroup_L->setWaffle(m_mapWaffleMap.value(i + 1));
+                ui->viewwidgetgroup_L->setWaffle(m_mapWaffleMap.value(i + 1), true);
                 m_allGroup[i]->setWaffleWidget(ui->viewwidgetgroup_L->getWaffle()->getGlobalPixmap());
             }
             if (manager->getMaterialBox()) {
@@ -150,7 +150,7 @@ void MainAndSecondaryCamerasWnd::InitPage()
             }
             if (manager->getBond()) {
                 m_mapBondMap.insert(num, manager->getBond());
-                ui->viewwidgetgroup_L->setBond(m_mapBondMap.value(i + 1));
+                ui->viewwidgetgroup_L->setBond(m_mapBondMap.value(i + 1),true);
                 m_allGroup[i]->setBondWidget(ui->viewwidgetgroup_L->getBond()->getGlobalPixmap());
             }
             if(!manager->getFileList().isEmpty()){
@@ -441,18 +441,18 @@ void MainAndSecondaryCamerasWnd::saveInfoOfLast() {
 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 1: ui->viewwidgetgroup_L->setWafer(m_mapWaferMap.value(groupId), true); break;
+        case 2: ui->viewwidgetgroup_L->setWaffle(m_mapWaffleMap.value(groupId), true); break;
+        case 3: ui->viewwidgetgroup_L->setMaterialBox(m_mapMaterialBoxMap.value(groupId), true); break;
+        case 4: ui->viewwidgetgroup_L->setBond(m_mapBondMap.value(groupId),true); break;
         }
     }
     else if (side == m_nCurrentRight) {
         switch (materialWndType) {
-        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 1: ui->viewwidgetgroup_R->setWafer(m_mapWaferMap.value(groupId), true); break;
+        case 2: ui->viewwidgetgroup_R->setWaffle(m_mapWaffleMap.value(groupId), true); break;
+        case 3: ui->viewwidgetgroup_R->setMaterialBox(m_mapMaterialBoxMap.value(groupId), true); break;
+        case 4: ui->viewwidgetgroup_R->setBond(m_mapBondMap.value(groupId),true); break;
         }
     }
 }
@@ -781,28 +781,28 @@ void MainAndSecondaryCamerasWnd::UpdateMaterialByTimer() {
         case 1: 
         {
             UpdateWafer(lastGroupId);
-            ui->viewwidgetgroup_R->setWafer(m_mapWaferMap.value(lastGroupId));
+            ui->viewwidgetgroup_R->setWafer(m_mapWaferMap.value(lastGroupId), false);
             m_allGroup[lastGroupId-1]->setWaferWidget(ui->viewwidgetgroup_R->getWafer()->getGlobalPixmap());
             break;
         }
         case 2: 
         {
             UpdateWaffle(lastGroupId);
-            ui->viewwidgetgroup_R->setWaffle(m_mapWaffleMap.value(lastGroupId));
+            ui->viewwidgetgroup_R->setWaffle(m_mapWaffleMap.value(lastGroupId), false);
             m_allGroup[lastGroupId - 1]->setWaffleWidget(ui->viewwidgetgroup_R->getWaffle()->getGlobalPixmap());
             break;
         }
         case 3:
         {
             UpdateMaterialBox(lastGroupId);
-            ui->viewwidgetgroup_R->setMaterialBox(m_mapMaterialBoxMap.value(lastGroupId));
+            ui->viewwidgetgroup_R->setMaterialBox(m_mapMaterialBoxMap.value(lastGroupId), false);
             m_allGroup[lastGroupId - 1]->MaterialBoxWidget();
             break;
         }
         case 4: 
         {
             UpdateBond(lastGroupId);
-            ui->viewwidgetgroup_R->setBond(m_mapBondMap.value(lastGroupId));
+            ui->viewwidgetgroup_R->setBond(m_mapBondMap.value(lastGroupId),false);
             m_allGroup[lastGroupId - 1]->setBondWidget(ui->viewwidgetgroup_R->getBond()->getGlobalPixmap());
             break;
         }
@@ -820,28 +820,28 @@ void MainAndSecondaryCamerasWnd::UpdateMaterialByTimer() {
         case 1:
         {
             UpdateWafer(lastLastGroupId);
-            ui->viewwidgetgroup_L->setWafer(m_mapWaferMap.value(lastLastGroupId));
+            ui->viewwidgetgroup_L->setWafer(m_mapWaferMap.value(lastLastGroupId), false);
             m_allGroup[lastLastGroupId - 1]->setWaferWidget(ui->viewwidgetgroup_L->getWafer()->getGlobalPixmap());
             break;
         }
         case 2:
         {
             UpdateWaffle(lastLastGroupId);
-            ui->viewwidgetgroup_L->setWaffle(m_mapWaffleMap.value(lastLastGroupId));
+            ui->viewwidgetgroup_L->setWaffle(m_mapWaffleMap.value(lastLastGroupId), false);
             m_allGroup[lastLastGroupId - 1]->setWaffleWidget(ui->viewwidgetgroup_L->getWaffle()->getGlobalPixmap());
             break;
         }
         case 3:
         {
             UpdateMaterialBox(lastLastGroupId);
-            ui->viewwidgetgroup_L->setMaterialBox(m_mapMaterialBoxMap.value(lastLastGroupId));
+            ui->viewwidgetgroup_L->setMaterialBox(m_mapMaterialBoxMap.value(lastLastGroupId), false);
             m_allGroup[lastLastGroupId - 1]->MaterialBoxWidget();
             break;
         }
         case 4:
         {
             UpdateBond(lastLastGroupId);
-            ui->viewwidgetgroup_L->setBond(m_mapBondMap.value(lastLastGroupId));
+            ui->viewwidgetgroup_L->setBond(m_mapBondMap.value(lastLastGroupId),false);
             m_allGroup[lastLastGroupId - 1]->setBondWidget(ui->viewwidgetgroup_L->getBond()->getGlobalPixmap());
             break;
         }

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

@@ -102,13 +102,13 @@ void SingleCameraOperationWnd::initFrom()
             if (manager->getWafer()) 
             {
                 waferMap.insert(num, manager->getWafer());
-                ui->viewwidgetgroup->setWafer(waferMap.value(i + 1));
+                ui->viewwidgetgroup->setWafer(waferMap.value(i + 1), true);
                 m_allGroup[i]->setWaferWidget(ui->viewwidgetgroup->getWafer()->getGlobalPixmap());
             }
             if (manager->getWaffle()) 
             {
                 waffleMap.insert(num, manager->getWaffle());
-                ui->viewwidgetgroup->setWaffle(waffleMap.value(i + 1));
+                ui->viewwidgetgroup->setWaffle(waffleMap.value(i + 1), true);
                 m_allGroup[i]->setWaffleWidget(ui->viewwidgetgroup->getWaffle()->getGlobalPixmap());
             }
             if (manager->getMaterialBox()) 
@@ -118,7 +118,7 @@ void SingleCameraOperationWnd::initFrom()
             if (manager->getBond()) 
             {
                 bondMap.insert(num, manager->getBond());
-                ui->viewwidgetgroup->setBond(bondMap.value(i + 1));
+                ui->viewwidgetgroup->setBond(bondMap.value(i + 1),true);
                 m_allGroup[i]->setBondWidget(ui->viewwidgetgroup->getBond()->getGlobalPixmap());
             }
             if (!manager->getFileList().isEmpty()) 
@@ -187,10 +187,10 @@ void SingleCameraOperationWnd::updateMaterialWidget(int materialWndType, int gro
 {
     switch (materialWndType)
     {
-    case 1: ui->viewwidgetgroup->setWafer(waferMap.value(groupId)); break;
-    case 2: ui->viewwidgetgroup->setWaffle(waffleMap.value(groupId)); break;
-    case 3: ui->viewwidgetgroup->setMaterialBox(materialBoxMap.value(groupId)); break;
-    case 4: ui->viewwidgetgroup->setBond(bondMap.value(groupId)); break;
+    case 1: ui->viewwidgetgroup->setWafer(waferMap.value(groupId), true); break;
+    case 2: ui->viewwidgetgroup->setWaffle(waffleMap.value(groupId), true); break;
+    case 3: ui->viewwidgetgroup->setMaterialBox(materialBoxMap.value(groupId), true); break;
+    case 4: ui->viewwidgetgroup->setBond(bondMap.value(groupId),true); break;
     }
 }
 
@@ -555,28 +555,28 @@ void SingleCameraOperationWnd::UpdateMaterialByTimer() {
         case 1:
         {
             UpdateWafer(lastGroupId);
-            ui->viewwidgetgroup->setWafer(waferMap.value(lastGroupId));
+            ui->viewwidgetgroup->setWafer(waferMap.value(lastGroupId), false);
             m_allGroup[lastGroupId - 1]->setWaferWidget(ui->viewwidgetgroup->getWafer()->getGlobalPixmap());
             break;
         }
         case 2:
         {
             UpdateWaffle(lastGroupId);
-            ui->viewwidgetgroup->setWaffle(waffleMap.value(lastGroupId));
+            ui->viewwidgetgroup->setWaffle(waffleMap.value(lastGroupId), false);
             m_allGroup[lastGroupId - 1]->setWaffleWidget(ui->viewwidgetgroup->getWaffle()->getGlobalPixmap());
             break;
         }
         case 3:
         {
             UpdateMaterialBox(lastGroupId);
-            ui->viewwidgetgroup->setMaterialBox(materialBoxMap.value(lastGroupId));
+            ui->viewwidgetgroup->setMaterialBox(materialBoxMap.value(lastGroupId), false);
             m_allGroup[lastGroupId - 1]->MaterialBoxWidget();
             break;
         }
         case 4:
         {
             UpdateBond(lastGroupId);
-            ui->viewwidgetgroup->setBond(bondMap.value(lastGroupId));
+            ui->viewwidgetgroup->setBond(bondMap.value(lastGroupId),false);
             m_allGroup[lastGroupId - 1]->setBondWidget(ui->viewwidgetgroup->getBond()->getGlobalPixmap());
             break;
         }

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

@@ -216,9 +216,15 @@ void ControlOperationPage::KindsofWidget(kinds kind)
     {
         ui->Operatewidget->setLayout(layout);
         m_currentMode = ModeView;
-
-        m_scaleFactor = 1.0;
-        applyScale();
+        if (isnew) {
+            m_scaleFactor = 1.0;
+            applyScale();
+        }
+        else {
+            updateScale(m_scaleFactor);
+        }
+        qDebug() << "1111" << m_mousePos;
+        
     }
 }
 
@@ -233,23 +239,48 @@ Waffle* ControlOperationPage::getWaffle() {
     return m_waffle;
 }
 
-void ControlOperationPage::setWafer(Wafer* wafer) {
+void ControlOperationPage::setWafer(Wafer* wafer, bool isNew) {
     m_wafer = wafer;
     updateMaterialWidget(wafer_kind);
+    if (isNew) {
+        isnew = true;
+    }
+    else {
+        isnew = false;
+    }
 
 }
-void ControlOperationPage::setWaffle(Waffle* waffle) {
+void ControlOperationPage::setWaffle(Waffle* waffle, bool isNew) {
     m_waffle = waffle;
     updateMaterialWidget(waffle_kind);
+    if (isNew) {
+        isnew = true;
+    }
+    else {
+        isnew = false;
+    }
 }
-void ControlOperationPage::setMaterialBox(MaterialBox* materialbox) {
+void ControlOperationPage::setMaterialBox(MaterialBox* materialbox, bool isNew) {
     m_materialbox = materialbox;
     updateMaterialWidget(materialbox_kind);
+    if (isNew) {
+        isnew = true;
+    }
+    else {
+        isnew = false;
+    }
 }
 
-void ControlOperationPage::setBond(Bond* bond) {
+void ControlOperationPage::setBond(Bond* bond, bool isNew) {
     m_bond = bond;
     updateMaterialWidget(bond_kind);
+    if (isNew) {
+        isnew = true;
+    }
+    else {
+        isnew = false;
+    }
+
 }
 
 void ControlOperationPage::initForm()

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

@@ -40,10 +40,10 @@ public:
     void applyScale();
     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, bool isNew);
+    void setWaffle(Waffle* waffle, bool isNew);
+    void setMaterialBox(MaterialBox* materialbox, bool isNew);
+    void setBond(Bond* bond,bool isNew);
     ImageWidget* getOperatewidget();
     void resizeSingleUI(bool bMax = false);
     void resizeChartsAndCamerasUI();
@@ -163,6 +163,7 @@ private:
     ST_MOVE_AXIS                m_currentSelectRunAxis = {};
     bool                        m_isAdd = false;
     bool                        m_isOpenJoystick = true;
+    bool                        isnew = true;
 };
 
 #endif // VIEWWIDGETGROUP_H