1
0

2 Коммитууд 13ce243542 ... 0319077f6a

Эзэн SHA1 Мессеж Огноо
  yun 0319077f6a Merge branch 'master' of http://47.116.26.105:10880/JonYang/JSBTDieBondH 2 өдөр өмнө
  yun 592745bad8 数据库是否变化以及保存功能以及物料刷新功能,目前物料刷新有bug待修复 2 өдөр өмнө

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

@@ -302,6 +302,9 @@ void Group::setWaffleWidget(QPixmap pixmap) {
     layout2->setContentsMargins(0, 0, 0, 0);
     layout2->addWidget(pixmapLabel);
 }
+void Group::setMaterialBox(MaterialBox* materialBox) {
+    m_pMaterialbox = materialBox;
+}
 
 void Group::SetCameaInfo(CameraInfo cameaInfo)
 {

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

@@ -38,10 +38,12 @@ public:
     void setWaferWidget(QPixmap pixmap);
     void setBondWidget(QPixmap pixmap);
     void setWafer(Wafer* wafer);
+    void setMaterialBox(MaterialBox* materialBox);
     void setWaffleWidget(QPixmap pixmap);
 
 
     void SetCameaInfo(CameraInfo cameaInfo);
+    void MaterialBoxWidget(); // 料盒
 
 signals:
     void send_button_Signal();
@@ -71,7 +73,7 @@ protected:
     void check_selected(int index);
     void WaferWidget(); // 圆晶
     void WaffleWidget(); // 华夫盒
-    void MaterialBoxWidget(); // 料盒
+    
     void BondWidget();
 
 private:

+ 99 - 1
View/die-bonder-ui/OriginalWnd/ChartsAndCamerasWnd.cpp

@@ -76,6 +76,9 @@ ChartsAndCamerasWnd::ChartsAndCamerasWnd(QWidget* parent) :
     QTimer* timer = new QTimer(this);
     connect(timer, &QTimer::timeout, this, &ChartsAndCamerasWnd::setColor);
     timer->start(100);
+    m_timerMaterial = new QTimer(this);
+    connect(m_timerMaterial, &QTimer::timeout, this, &ChartsAndCamerasWnd::UpdateMaterialByTimer);
+    m_pCViewInterface = ns_module::CViewInterface::GetInstance();
 }
 
 void ChartsAndCamerasWnd::setColor()
@@ -583,7 +586,7 @@ void ChartsAndCamerasWnd::initWidget() {
         BindImageOrMaterial(m_nMaterialIndex);
 
     }
-
+    //m_timerMaterial->start(1000);
 }
 
 void ChartsAndCamerasWnd::saveInfoOfLast() {
@@ -688,5 +691,100 @@ void ChartsAndCamerasWnd::HandleComboxchange(int index) {
     }
 }
 
+void ChartsAndCamerasWnd::UpdateMaterialByTimer() {
+    //判断当前大窗口是否是物料窗口
+    if (lastIndex == 2) {
+        QSettings settings("YourOrganization", "YourApplication");
+        settings.beginGroup(QString::number(m_veCurrentSelectGroup.pSelectGroup->m_nGroupId));
+        int MaterialWndType = settings.value("MaterialWndType").toInt();
+        settings.endGroup();
+        switch (MaterialWndType) {
+        case 1:
+        {
+            UpdateWafer(lastGroupId);
+            ui->viewwidgetgroup->setWafer(waferMap.value(lastGroupId));
+            m_allGroup[lastGroupId - 1]->setWaferWidget(ui->viewwidgetgroup->getWafer()->getGlobalPixmap());
+            break;
+        }
+        case 2:
+        {
+            UpdateWaffle(lastGroupId);
+            ui->viewwidgetgroup->setWaffle(waffleMap.value(lastGroupId));
+            m_allGroup[lastGroupId - 1]->setWaffleWidget(ui->viewwidgetgroup->getWaffle()->getGlobalPixmap());
+            break;
+        }
+        case 3:
+        {
+            UpdateMaterialBox(lastGroupId);
+            ui->viewwidgetgroup->setMaterialBox(materialBoxMap.value(lastGroupId));
+            m_allGroup[lastGroupId - 1]->MaterialBoxWidget();
+            break;
+        }
+        case 4:
+        {
+            UpdateBond(lastGroupId);
+            ui->viewwidgetgroup->setBond(bondMap.value(lastGroupId));
+            m_allGroup[lastGroupId - 1]->setBondWidget(ui->viewwidgetgroup->getBond()->getGlobalPixmap());
+            break;
+        }
+        }
+
+    }
+
+}
+
+void ChartsAndCamerasWnd::UpdateWafer(int groupId) {
+    if (m_pCViewInterface != nullptr)
+    {
+        std::vector<ns_mat::WAFER_MATRIX_POINT_INFO_STRUCT> veWafer;
+        m_pCViewInterface->GetViewMatrix()->GetWaferAllPointInfo(veWafer);
+        waferMap.value(groupId)->UpdataVal(veWafer);
+        waferMap.value(groupId)->setWaferInfo(m_pCViewInterface);
+    }
+    else
+    {
+        waferMap.value(groupId)->UpdataGenerateTestData();
+    }
+}
+void ChartsAndCamerasWnd::UpdateWaffle(int groupId) {
+    if (m_pCViewInterface != nullptr)
+    {
+        std::vector<ns_mat::WAFFLE_MATRIX_POINT_STRUCT> veWaffle;
+        m_pCViewInterface->GetViewMatrix()->GetWafflePackAllPointInfo(veWaffle);
+        waffleMap.value(groupId)->UpdataVal(veWaffle);
+    }
+    else
+    {
+        waffleMap.value(groupId)->UpdataGenerateTestData();
+    }
+}
+void ChartsAndCamerasWnd::UpdateBond(int groupId) {
+    if (m_pCViewInterface != nullptr)
+    {
+        std::vector<ns_mat::POINT_INFO_STRUCT> stPointInfo;
+        m_pCViewInterface->GetViewMatrix()->GetBondAllPointInfo(stPointInfo);
+        bondMap.value(groupId)->UpdataVal(stPointInfo);
+        bondMap.value(groupId)->setBondInfo(m_pCViewInterface);
+    }
+    else
+    {
+        bondMap.value(groupId)->UpdataGenerateTestData();
+    }
+}
+void ChartsAndCamerasWnd::UpdateMaterialBox(int groupId) {
+    if (m_pCViewInterface != nullptr)
+    {
+        std::vector<ns_module::MATERIAL_BOX_STRUCT> veMaterial;
+
+        m_pCViewInterface->GetViewMatrix()->GetMaterialBoxAllPointInfo(veMaterial);
+        materialBoxMap.value(groupId)->UpdataVal(veMaterial);
+        materialBoxMap.value(groupId)->setMaterialBoxInfo(m_pCViewInterface);
+    }
+    else
+    {
+        materialBoxMap.value(groupId)->UpdataGenerateTestData();
+    }
+}
+
 
 

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

@@ -12,7 +12,8 @@
 #include "JOriginalMainWnd.h"
 #include "CameraDataHandleAndShow.h"
 #include "CameraMaterialGroupWnd/MaterialWindow/Bond.h"
-
+#include <QTimer>
+#include <CViewInterface.h>
 namespace Ui {
     class ChartsAndCamerasWnd;
 }
@@ -36,6 +37,12 @@ public:
     void initWidget();
     void UpdataLightJoystickSwitchPage(int groupId, bool isShow);
 
+    void UpdateMaterialByTimer();
+    void UpdateWafer(int groupId);
+    void UpdateWaffle(int groupId);
+    void UpdateBond(int groupId);
+    void UpdateMaterialBox(int groupId);
+
 protected:
     void wheelEvent(QWheelEvent* event) override;
     void checkSettings(int groupId, int index);
@@ -148,6 +155,8 @@ private:
     ST_CURRENT_SELECT_GROUP         m_veCurrentSelectGroup;
     const int                       m_nImageIndex = 1;
     const int                       m_nMaterialIndex = 2;
+    QTimer* m_timerMaterial;
+    ns_module::CViewInterface* m_pCViewInterface;
 
 };
 

+ 55 - 203
View/die-bonder-ui/OriginalWnd/DbTreeViewManager.cpp

@@ -2242,52 +2242,7 @@ void DbTreeViewManager::displayThirdLevelFields(const QList<ST_TABLE_CONTROL_DAT
                         m_fieldWidgets.append(unitLabel);
                         createdWidget = inputWidget;
                         // // 连接 textChanged 信号到 lambda 函数
-                        //connect(lineEdit, &QLineEdit::textChanged, [this, lineEdit, fieldTableName, fieldName, fieldUpLimit, fieldDownLimit]() {
-                        //    if ((fieldUpLimit != "") && (fieldDownLimit != ""))
-                        //    {
-                        //        int uplimit = fieldUpLimit.toInt();
-                        //        int downlimit = fieldDownLimit.toInt();
-                        //        int inputvalue = (lineEdit->text()).toInt();
-                        //        if ((inputvalue <= uplimit) && (inputvalue >= downlimit))
-                        //        {
-                        //            m_sqlOper->updateControlData(fieldTableName, fieldName, lineEdit->text());
-                        //            //updateDb(fieldTableName, fieldId, lineEdit->text());
-                        //        } else
-                        //        {
-                        //            lineEdit->setPlaceholderText(tr("超出设定范围,请重新输入"));
-                        //        }
-                        //    } else if (fieldDownLimit != "")
-                        //    {
-                        //        int downlimit = fieldDownLimit.toInt();
-                        //        int inputvalue = (lineEdit->text()).toInt();
-                        //        if (inputvalue >= downlimit)
-                        //        {
-                        //            m_sqlOper->updateControlData(fieldTableName, fieldName, lineEdit->text());
-                        //            //updateDb(fieldTableName, fieldId, lineEdit->text());
-                        //        } else
-                        //        {
-                        //            lineEdit->setPlaceholderText(tr("超出设定范围,请重新输入"));
-                        //        }
-                        //    } else if (fieldUpLimit != "")
-                        //    {
-                        //        int uplimit = fieldUpLimit.toInt();
-                        //        int inputvalue = (lineEdit->text()).toInt();
-                        //        if (inputvalue <= uplimit)
-                        //        {
-                        //            m_sqlOper->updateControlData(fieldTableName, fieldName, lineEdit->text());
-                        //            //updateDb(fieldTableName, fieldId, lineEdit->text());
-                        //        } else
-                        //        {
-                        //            lineEdit->setPlaceholderText(tr("超出设定范围,请重新输入"));
-                        //        }
-                        //    } else
-                        //    {
-                        //        m_sqlOper->updateControlData(fieldTableName, fieldName, lineEdit->text());
-                        //        //updateDb(fieldTableName, fieldId, lineEdit->text());
-                        //    }
-
-                        //    });
-						connect(lineEdit, &QLineEdit::textChanged, [this, fieldType,lineEdit, fieldUpLimit, fieldDownLimit, pFieldDescribeLabel]() {
+						connect(lineEdit, &QLineEdit::textChanged, [this, fieldType,lineEdit, fieldUpLimit, fieldDownLimit, pFieldDescribeLabel,fieldValue]() {
 							if ((fieldUpLimit != "") && (fieldDownLimit != ""))
 							{
                                 if (fieldType == "LONG")
@@ -2301,8 +2256,6 @@ void DbTreeViewManager::displayThirdLevelFields(const QList<ST_TABLE_CONTROL_DAT
                                         pFieldDescribeLabel->setDisabled(true);
                                         //label->setStyleSheet("color: #5c63be;");
                                         modifiedLabels.insert(pFieldDescribeLabel);
-                                        // m_sqlOper->updateControlData(fieldTableName, fieldName, lineEdit->text());
-                                        //updateDb(fieldTableName, fieldId, lineEdit->text());
                                     }
                                     else
                                     {
@@ -2403,9 +2356,14 @@ void DbTreeViewManager::displayThirdLevelFields(const QList<ST_TABLE_CONTROL_DAT
 								// m_sqlOper->updateControlData(fieldTableName, fieldName, lineEdit->text());
 								//updateDb(fieldTableName, fieldId, lineEdit->text());
 							}
+                            if (fieldValue == lineEdit->text()) {
+                                pFieldDescribeLabel->setDisabled(false);
+                                modifiedLabels.remove(pFieldDescribeLabel);
+                            }
 
 							});
 
+
 						connect(this, &DbTreeViewManager::saveClicked, [this, fieldTableName, fieldName, pFieldDescribeLabel]() {
 							if (modifiedLabels.contains(pFieldDescribeLabel)) {
 								m_sqlOper->updateControlData(fieldTableName, fieldName, pFieldDescribeLabel->property("value").toString());
@@ -2436,33 +2394,20 @@ void DbTreeViewManager::displayThirdLevelFields(const QList<ST_TABLE_CONTROL_DAT
                         lineEdit1->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
                         lineEdit1->setFixedSize(140, 28);
                         lineEdit1->setAlignment(Qt::AlignLeft);
-                        /*lineEdit1->setStyleSheet(R"(
-                        QLineEdit {
-                            background: #FFFFFF;
-                            border: 1px solid #BABBDC;
-                            border-radius: 6px;
-                            padding: 2px 5px;
-                        }
-                        QLineEdit:disabled {
-                            background: #eeeeee;
-                        }
-                    )");*/
+
                         rightLayout->addWidget(lineEdit1);
                         createdWidget = lineEdit1;
-                        // // 连接 textChanged 信号到 lambda 函数
-                        //connect(lineEdit1, &QLineEdit::textChanged, [this, lineEdit1, fieldTableName, fieldName]() {
-                        //    m_sqlOper->updateControlData(fieldTableName, fieldName, lineEdit1->text());
-                        //    //updateDb(fieldTableName, fieldId, lineEdit1->text());
-                        //    loginput(fieldTableName, fieldName, lineEdit1->text());
-                        //    });
-                        connect(lineEdit1, &QLineEdit::textChanged, [this, lineEdit1, pFieldDescribeLabel]() {
+                        // 连接 textChanged 信号到 lambda 函数
+
+                        connect(lineEdit1, &QLineEdit::textChanged, [this, lineEdit1, pFieldDescribeLabel, fieldValue]() {
                             pFieldDescribeLabel->setProperty("value", lineEdit1->text());
                             pFieldDescribeLabel->setDisabled(true);
                             //label->setStyleSheet("color: #5c63be;");
                             modifiedLabels.insert(pFieldDescribeLabel);
-                            // m_sqlOper->updateControlData(fieldTableName, fieldName, lineEdit1->text());
-                            //updateDb(fieldTableName, fieldId, lineEdit1->text());
-                            // loginput(fieldTableName, fieldName, lineEdit1->text());
+                            if (fieldValue == lineEdit1->text()) {
+                                pFieldDescribeLabel->setDisabled(false);
+                                modifiedLabels.remove(pFieldDescribeLabel);
+                            }
                             });
 
                         connect(this, &DbTreeViewManager::saveClicked, [this, fieldTableName, fieldName, pFieldDescribeLabel]() {
@@ -2520,23 +2465,17 @@ void DbTreeViewManager::displayThirdLevelFields(const QList<ST_TABLE_CONTROL_DAT
                         }
                     }
                     // 使用Lambda函数连接 buttonToggled 信号
-                    //connect(radioGroup, static_cast<void (QButtonGroup::*)(QAbstractButton*, bool)>(&QButtonGroup::buttonToggled), [this, fieldTableName, fieldName](QAbstractButton* button, bool checked) {
-                    //    if (checked)
-                    //    {
-                    //        // qDebug() << "Button toggled:" << button->text();
-                    //        // 在这里添加你想要执行的操作
-                    //        m_sqlOper->updateControlData(fieldTableName, fieldName, button->text());
-                    //        //updateDb(fieldTableName, fieldId, button->text());
-                    //    }
-                    //    });
-                    connect(radioGroup, static_cast<void (QButtonGroup::*)(QAbstractButton*, bool)>(&QButtonGroup::buttonToggled), [this, pFieldDescribeLabel](QAbstractButton* button, bool checked) {
+                    connect(radioGroup, static_cast<void (QButtonGroup::*)(QAbstractButton*, bool)>(&QButtonGroup::buttonToggled), [this, pFieldDescribeLabel, fieldValue](QAbstractButton* button, bool checked) {
                         if (checked)
                         {
                             pFieldDescribeLabel->setProperty("value", button->text());
                             pFieldDescribeLabel->setDisabled(true);
                             //label->setStyleSheet("color: #5c63be;");
                             modifiedLabels.insert(pFieldDescribeLabel);
-                            // qDebug() << "Button toggled:" << button->text();
+                            if (fieldValue == button->text()) {
+                                pFieldDescribeLabel->setDisabled(false);
+                                modifiedLabels.remove(pFieldDescribeLabel);
+                            }
                             // 在这里添加你想要执行的操作
                             // m_sqlOper->updateControlData(fieldTableName, fieldName, button->text());
                             //updateDb(fieldTableName, fieldId, button->text());
@@ -2600,38 +2539,20 @@ void DbTreeViewManager::displayThirdLevelFields(const QList<ST_TABLE_CONTROL_DAT
                     QCheckBox* checkBox = new QCheckBox;
                     checkBox->setChecked(isChecked);
                     checkBox->setProperty("type", "checkBox");
-                    /*checkBox->setStyleSheet(R"(
-                    QCheckBox::indicator {
-                        width: 20px;
-                        height: 20px;
-                    }
-                    QCheckBox::indicator:unchecked {
-                        background-color: #FFFFFF;
-                        border: 1px solid #BABBDC;
-                        border-radius: 2px;
-                    }
-                    QCheckBox::indicator:checked {
-                        image: url(:/images/three_Selecte.png);
-                    }
-                    QCheckBox {
-                        spacing: 0px;
-                    }
-                    QCheckBox::indicator:disabled {
-                        background-color: #eeeeee;
-                    }
-                )");*/
                     rightLayout->addWidget(checkBox);
                     createdWidget = checkBox;
-                    connect(checkBox, &QCheckBox::stateChanged, [this, pFieldDescribeLabel](int state)
+                    connect(checkBox, &QCheckBox::stateChanged, [this, pFieldDescribeLabel,fieldValue](int state)
                     {
                         if (state == Qt::Checked)
                         {
-                            // m_sqlOper->updateControlData(fieldTableName, fieldName, "1");
-                            //updateDb(fieldTableName, fieldId, "1");
+
                             pFieldDescribeLabel->setProperty("value", "1");
                             pFieldDescribeLabel->setDisabled(true);
-                            //label->setStyleSheet("color: #5c63be;");
                             modifiedLabels.insert(pFieldDescribeLabel);
+                            if (fieldValue == "1") {
+                                pFieldDescribeLabel->setDisabled(false);
+                                modifiedLabels.remove(pFieldDescribeLabel);
+                            }
                         }
                         else if (state == Qt::Unchecked)
                         {
@@ -2642,6 +2563,10 @@ void DbTreeViewManager::displayThirdLevelFields(const QList<ST_TABLE_CONTROL_DAT
                             pFieldDescribeLabel->setDisabled(true);
                             //label->setStyleSheet("color: #5c63be;");
                             modifiedLabels.insert(pFieldDescribeLabel);
+                            if (fieldValue != "1") {
+                                pFieldDescribeLabel->setDisabled(false);
+                                modifiedLabels.remove(pFieldDescribeLabel);
+                            }
                         }
                         else if (state == Qt::PartiallyChecked)
                         {
@@ -2711,34 +2636,6 @@ void DbTreeViewManager::displayThirdLevelFields(const QList<ST_TABLE_CONTROL_DAT
                     QComboBox* comboBox = new QComboBox;
                     comboBox->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
                     comboBox->setFixedSize(140, 28);
-                    /*comboBox->setStyleSheet(R"(
-                    QComboBox {
-                        background: #FFFFFF;
-                        border: 1px solid #BABBDC;
-                        border-radius: 6px;
-                        padding: 2px 5px;
-                    }
-                    QComboBox::drop-down {
-                        width: 20px;
-                    }
-                    QComboBox::disabled {
-                        background-color: #eeeeee;
-                    }
-                )");*/
-                    // int newIndex = -1;
-                    /*for (const QString& opt : optionList)
-                    {
-                        QString trimmedOpt = opt.trimmed();
-                        if (!trimmedOpt.isEmpty())
-                            comboBox->addItem(trimmedOpt);
-                    }
-                    if (fieldValue == "")
-                    {
-                        comboBox->setCurrentIndex(0);
-                    } else
-                    {
-                        comboBox->setCurrentIndex(fieldValue.toInt());
-                    }*/
                     int matchedIndex = -1;
                     int currentIndex = 0;
 
@@ -2760,16 +2657,8 @@ void DbTreeViewManager::displayThirdLevelFields(const QList<ST_TABLE_CONTROL_DAT
                     rightLayout->addWidget(comboBox);
                     createdWidget = comboBox;
                     // 使用Lambda函数连接 currentIndexChanged 信号
-                    //connect(comboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), [this, comboBox, fieldTableName, fieldName](int index) {
-                    //    QString selectedText = comboBox->itemText(index);
-                    //    QString indexString = QString::number(index);
-                    //    // qDebug() << "ComboBox index changed to:" << index << "Text:" << selectedText;
-                    //    m_sqlOper->updateControlData(fieldTableName, fieldName, indexString);
-                    //    //updateDb(fieldTableName, fieldId, indexString);
-                    //    // 在这里添加你想要执行的操作
-                    //    });
                     connect(comboBox, QOverload<int>::of(&QComboBox::currentIndexChanged),
-                        [this, comboBox, jsonArray, pFieldDescribeLabel](int index)
+                        [this, comboBox, jsonArray, pFieldDescribeLabel, fieldValue](int index)
                         {
                             QString selectedText = comboBox->itemText(index);
                             QString valueString;
@@ -2787,6 +2676,11 @@ void DbTreeViewManager::displayThirdLevelFields(const QList<ST_TABLE_CONTROL_DAT
                             pFieldDescribeLabel->setDisabled(true);
                             //label->setStyleSheet("color: #5c63be;");
                             modifiedLabels.insert(pFieldDescribeLabel);
+                            if (selectedText == fieldValue.trimmed())
+                            {
+                                pFieldDescribeLabel->setDisabled(false);
+                                modifiedLabels.remove(pFieldDescribeLabel);
+                            }
                         });
 
                     connect(this, &DbTreeViewManager::saveClicked, [this, fieldTableName, fieldName, pFieldDescribeLabel]() {
@@ -2842,34 +2736,24 @@ void DbTreeViewManager::displayThirdLevelFields(const QList<ST_TABLE_CONTROL_DAT
                     QTimeEdit* timeEdit = new QTimeEdit;
                     timeEdit->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
                     timeEdit->setFixedSize(120, 28);
-                    /*timeEdit->setStyleSheet(R"(
-                    QTimeEdit {
-                        background: #FFFFFF;
-                        border: 1px solid #BABBDC;
-                        border-radius: 6px;
-                        padding: 2px 5px;
-                    }
-                    QTimeEdit::disabled {
-                        background-color: #eeeeee;
-                    }
-                )");*/
                     timeEdit->setDisplayFormat("HH:mm:ss");
                     timeEdit->setTime(QTime::fromString(fieldValue, "HH:mm:ss"));
                     rightLayout->addWidget(timeEdit);
                     createdWidget = timeEdit;
-                    connect(timeEdit, &QTimeEdit::timeChanged, [this, timeEdit, pFieldDescribeLabel]() {
+                    connect(timeEdit, &QTimeEdit::timeChanged, [this, timeEdit, pFieldDescribeLabel, fieldValue]() {
                         QString timeString = timeEdit->time().toString("HH:mm:ss");
                         pFieldDescribeLabel->setProperty("value", timeString);
                         pFieldDescribeLabel->setDisabled(true);
-                        //label->setStyleSheet("color: #5c63be;");
                         modifiedLabels.insert(pFieldDescribeLabel);
+                        if (fieldValue == timeString) {
+                            pFieldDescribeLabel->setDisabled(false);
+                        }
                         });
 
                     connect(this, &DbTreeViewManager::saveClicked, [this, fieldTableName, fieldName, pFieldDescribeLabel]() {
                         if (modifiedLabels.contains(pFieldDescribeLabel)) {
                             m_sqlOper->updateControlData(fieldTableName, fieldName, pFieldDescribeLabel->property("value").toString());
                             pFieldDescribeLabel->setDisabled(false);
-                            //label->setStyleSheet("color: black;");
                             modifiedLabels.remove(pFieldDescribeLabel);
                         }
                         });
@@ -2904,23 +2788,6 @@ void DbTreeViewManager::displayThirdLevelFields(const QList<ST_TABLE_CONTROL_DAT
                     switchBox->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
                     switchBox->setFixedSize(30, 30);
                     switchBox->setProperty("type", "switch");
-                    /*switchBox->setStyleSheet(R"(
-                    QCheckBox::indicator {
-                        width: 30px;
-                        height: 30px;
-                    }
-                    QCheckBox::indicator:unchecked {
-                        background-color: #BABBDC;
-                        border-radius: 6px;
-                    }
-                    QCheckBox::indicator:checked {
-                        background-color: #4CAF50;
-                        border-radius: 6px;
-                    }
-                    QCheckBox::indicator:disabled {
-                        background-color: #eeeeee;
-                    }
-                )");*/
                     QString switchValue;
 
                     if (fieldValue == "")
@@ -2941,48 +2808,37 @@ void DbTreeViewManager::displayThirdLevelFields(const QList<ST_TABLE_CONTROL_DAT
                     }
                     QLabel* switchLabel = new QLabel(switchBox->isChecked() ? tr("Open","开") :tr("Close","关"));
                     switchLabel->setAlignment(Qt::AlignVCenter | Qt::AlignLeft);
-                    //switchLabel->setStyleSheet("font-size: 14px;");
-                    //connect(switchBox, &QCheckBox::stateChanged, [fieldTableName, fieldName, switchLabel, this](int state) {
-                    //    if (state == Qt::Checked)
-                    //    {
-                    //        switchLabel->setText(tr("开"));
-                    //        m_sqlOper->updateControlData(fieldTableName, fieldName, "on");
-                    //        //updateDb(fieldTableName, fieldId, "on");
-                    //    } else
-                    //    {
-                    //        switchLabel->setText(tr("关"));
-                    //        m_sqlOper->updateControlData(fieldTableName, fieldName, "off");
-                    //        //updateDb(fieldTableName, fieldId, "off");
-                    //    }
-                    //    });
-                    connect(switchBox, &QCheckBox::stateChanged, [switchLabel, this, pFieldDescribeLabel](int state) {
+                   
+                    connect(switchBox, &QCheckBox::stateChanged, [switchLabel, this, pFieldDescribeLabel, fieldValue](int state) {
                         if (state == Qt::Checked)
                         {
                             switchLabel->setText(tr("Open","开"));
                             pFieldDescribeLabel->setProperty("value", "on");
                             pFieldDescribeLabel->setDisabled(true);
-                            //label->setStyleSheet("color: #5c63be;");
                             modifiedLabels.insert(pFieldDescribeLabel);
-                            // m_sqlOper->updateControlData(fieldTableName, fieldName, "on");
-                            //updateDb(fieldTableName, fieldId, "on");
+                            if (fieldValue.toLower() == "on") {
+                                pFieldDescribeLabel->setDisabled(false);
+                                modifiedLabels.remove(pFieldDescribeLabel);
+                            }
                         }
                         else
                         {
                             switchLabel->setText(tr("Close","关"));
                             pFieldDescribeLabel->setProperty("value", "off");
                             pFieldDescribeLabel->setDisabled(true);
-                            //label->setStyleSheet("color: #5c63be;");
                             modifiedLabels.insert(pFieldDescribeLabel);
-                            // m_sqlOper->updateControlData(fieldTableName, fieldName, "off");
-                            //updateDb(fieldTableName, fieldId, "off");
+                            if (fieldValue.toLower() != "on") {
+                                pFieldDescribeLabel->setDisabled(false);
+                                modifiedLabels.remove(pFieldDescribeLabel);
+                            }
                         }
+
                         });
 
                     connect(this, &DbTreeViewManager::saveClicked, [this, fieldTableName, fieldName, pFieldDescribeLabel]() {
                         if (modifiedLabels.contains(pFieldDescribeLabel)) {
                             m_sqlOper->updateControlData(fieldTableName, fieldName, pFieldDescribeLabel->property("value").toString());
                             pFieldDescribeLabel->setDisabled(false);
-                            //label->setStyleSheet("color: black;");
                             modifiedLabels.remove(pFieldDescribeLabel);
                         }
                         });
@@ -3062,11 +2918,14 @@ void DbTreeViewManager::displayThirdLevelFields(const QList<ST_TABLE_CONTROL_DAT
 
                     m_veCombinedCont.push_back(_a);
 
-                    connect(comboInput, &QLineEdit::textChanged, [this, comboInput, pFieldDescribeLabel]() {
+                    connect(comboInput, &QLineEdit::textChanged, [this, comboInput, pFieldDescribeLabel, inputText]() {
                         pFieldDescribeLabel->setProperty("value", comboInput->text());
                         pFieldDescribeLabel->setDisabled(true);
-                        //label->setStyleSheet("color: #5c63be;");
                         modifiedLabels.insert(pFieldDescribeLabel);
+                        if (comboInput->text().trimmed() == inputText.trimmed()) {
+                            pFieldDescribeLabel->setDisabled(false);
+                            modifiedLabels.remove(pFieldDescribeLabel);
+                        }
                         });
 
                     connect(this, &DbTreeViewManager::saveClicked, [this, fieldTableName, fieldName, pFieldDescribeLabel]() {
@@ -3074,7 +2933,6 @@ void DbTreeViewManager::displayThirdLevelFields(const QList<ST_TABLE_CONTROL_DAT
                         {
                             m_sqlOper->updateControlData(fieldTableName, fieldName, pFieldDescribeLabel->property("value").toString());
                             pFieldDescribeLabel->setDisabled(false);
-                            //label->setStyleSheet("color: black;");
                             modifiedLabels.remove(pFieldDescribeLabel);
                         }
                         });
@@ -3090,12 +2948,6 @@ void DbTreeViewManager::displayThirdLevelFields(const QList<ST_TABLE_CONTROL_DAT
                             }
 
                             comboInput->setText(QString::number(strNum, 'f', 2));
-                            //QPushButton* senderBtn = qobject_cast<QPushButton*>(sender());
-                            //if (senderBtn) {
-                            //    QString strOnclick = senderBtn->property("Get").toString();
-                            //    qDebug() << "Clicked ID:" << strOnclick;
-                            //}
-                            // JMessageTip::Message_question(m_veCombinedCont[0].pLineC->text());
                         }, [this, comboInput, strstrModuleType, strAxisType, fieldTableName, fieldName]()
                         {
                             QPushButton* senderBtn = qobject_cast<QPushButton*>(sender());

+ 140 - 0
View/die-bonder-ui/OriginalWnd/MainAndSecondaryCamerasWnd.cpp

@@ -29,6 +29,9 @@ MainAndSecondaryCamerasWnd::MainAndSecondaryCamerasWnd(QWidget* parent)
     m_veCurrentSelectGroup_L.isInitialed = false;
     m_veCurrentSelectGroup_R.isBond = false;
     m_veCurrentSelectGroup_L.isBond = false;
+    m_timerMaterial = new QTimer(this);
+    connect(m_timerMaterial, &QTimer::timeout, this, &MainAndSecondaryCamerasWnd::UpdateMaterialByTimer);
+    m_pCViewInterface = ns_module::CViewInterface::GetInstance();
 }
 
 MainAndSecondaryCamerasWnd::~MainAndSecondaryCamerasWnd()
@@ -337,6 +340,7 @@ void MainAndSecondaryCamerasWnd::initLeftAndRightWidget() {
 
         }
     }
+    //m_timerMaterial->start(1000);
 }
 
 void MainAndSecondaryCamerasWnd::BindImageOrMaterial(int location, int index) 
@@ -744,3 +748,139 @@ void MainAndSecondaryCamerasWnd::HandleComboxchange_R(int index) {
         m_veCurrentSelectGroup_R.pSelectGroup->UpDataImageShowSlots(updatePixmap);
     }
 }
+
+void MainAndSecondaryCamerasWnd::UpdateMaterialByTimer() {
+    qDebug() << "Qtimer test";
+    //判断当前大窗口是否是物料窗口
+    //判断右窗口是否为物料窗口
+    if (lastIndex == 2) {
+        QSettings settings("YourOrganization", "YourApplication");
+        settings.beginGroup(QString::number(m_veCurrentSelectGroup_R.pSelectGroup->m_nGroupId));
+        int rightMaterialWndType = settings.value("MaterialWndType").toInt();
+        settings.endGroup();
+        switch (rightMaterialWndType) {
+        case 1: 
+        {
+            UpdateWafer(lastGroupId);
+            ui->viewwidgetgroup_R->setWafer(m_mapWaferMap.value(lastGroupId));
+            m_allGroup[lastGroupId-1]->setWaferWidget(ui->viewwidgetgroup_R->getWafer()->getGlobalPixmap());
+            break;
+        }
+        case 2: 
+        {
+            UpdateWaffle(lastGroupId);
+            ui->viewwidgetgroup_R->setWaffle(m_mapWaffleMap.value(lastGroupId));
+            m_allGroup[lastGroupId - 1]->setWaffleWidget(ui->viewwidgetgroup_R->getWaffle()->getGlobalPixmap());
+            break;
+        }
+        case 3:
+        {
+            UpdateMaterialBox(lastGroupId);
+            ui->viewwidgetgroup_R->setMaterialBox(m_mapMaterialBoxMap.value(lastGroupId));
+            m_allGroup[lastGroupId - 1]->MaterialBoxWidget();
+            break;
+        }
+        case 4: 
+        {
+            UpdateBond(lastGroupId);
+            ui->viewwidgetgroup_R->setBond(m_mapBondMap.value(lastGroupId));
+            m_allGroup[lastGroupId - 1]->setBondWidget(ui->viewwidgetgroup_R->getBond()->getGlobalPixmap());
+            break;
+        }
+        }
+
+    }
+
+    //判断左窗口是否为物料窗口
+    if (lastLastIndex == 2) {
+        QSettings settings("YourOrganization", "YourApplication");
+        settings.beginGroup(QString::number(m_veCurrentSelectGroup_L.pSelectGroup->m_nGroupId));
+        int leftMaterialWndType = settings.value("MaterialWndType").toInt();
+        settings.endGroup();
+        switch (leftMaterialWndType) {
+        case 1:
+        {
+            UpdateWafer(lastLastGroupId);
+            ui->viewwidgetgroup_L->setWafer(m_mapWaferMap.value(lastLastGroupId));
+            m_allGroup[lastLastGroupId - 1]->setWaferWidget(ui->viewwidgetgroup_L->getWafer()->getGlobalPixmap());
+            break;
+        }
+        case 2:
+        {
+            UpdateWaffle(lastLastGroupId);
+            ui->viewwidgetgroup_L->setWaffle(m_mapWaffleMap.value(lastLastGroupId));
+            m_allGroup[lastLastGroupId - 1]->setWaffleWidget(ui->viewwidgetgroup_L->getWaffle()->getGlobalPixmap());
+            break;
+        }
+        case 3:
+        {
+            UpdateMaterialBox(lastLastGroupId);
+            ui->viewwidgetgroup_L->setMaterialBox(m_mapMaterialBoxMap.value(lastLastGroupId));
+            m_allGroup[lastLastGroupId - 1]->MaterialBoxWidget();
+            break;
+        }
+        case 4:
+        {
+            UpdateBond(lastLastGroupId);
+            ui->viewwidgetgroup_L->setBond(m_mapBondMap.value(lastLastGroupId));
+            m_allGroup[lastLastGroupId - 1]->setBondWidget(ui->viewwidgetgroup_L->getBond()->getGlobalPixmap());
+            break;
+        }
+        }
+
+    }
+
+}   
+
+void MainAndSecondaryCamerasWnd::UpdateWafer(int groupId) {
+    if (m_pCViewInterface != nullptr)
+    {
+        std::vector<ns_mat::WAFER_MATRIX_POINT_INFO_STRUCT> veWafer;
+        m_pCViewInterface->GetViewMatrix()->GetWaferAllPointInfo(veWafer);
+        m_mapWaferMap.value(groupId)->UpdataVal(veWafer);
+        m_mapWaferMap.value(groupId)->setWaferInfo(m_pCViewInterface);
+    }
+    else
+    {
+        m_mapWaferMap.value(groupId)->UpdataGenerateTestData();
+    }
+}
+void MainAndSecondaryCamerasWnd::UpdateWaffle(int groupId) {
+    if (m_pCViewInterface != nullptr)
+    {
+        std::vector<ns_mat::WAFFLE_MATRIX_POINT_STRUCT> veWaffle;
+        m_pCViewInterface->GetViewMatrix()->GetWafflePackAllPointInfo(veWaffle);
+        m_mapWaffleMap.value(groupId)->UpdataVal(veWaffle);
+    }
+    else
+    {
+        m_mapWaffleMap.value(groupId)->UpdataGenerateTestData();
+    }
+}
+void MainAndSecondaryCamerasWnd::UpdateBond(int groupId) {
+    if (m_pCViewInterface != nullptr)
+    {
+        std::vector<ns_mat::POINT_INFO_STRUCT> stPointInfo;
+        m_pCViewInterface->GetViewMatrix()->GetBondAllPointInfo(stPointInfo);
+        m_mapBondMap.value(groupId)->UpdataVal(stPointInfo);
+        m_mapBondMap.value(groupId)->setBondInfo(m_pCViewInterface);
+    }
+    else
+    {
+        m_mapBondMap.value(groupId)->UpdataGenerateTestData();
+    }
+}
+void MainAndSecondaryCamerasWnd::UpdateMaterialBox(int groupId) {
+    if (m_pCViewInterface != nullptr)
+    {
+        std::vector<ns_module::MATERIAL_BOX_STRUCT> veMaterial;
+
+        m_pCViewInterface->GetViewMatrix()->GetMaterialBoxAllPointInfo(veMaterial);
+        m_mapMaterialBoxMap.value(groupId)->UpdataVal(veMaterial);
+        m_mapMaterialBoxMap.value(groupId)->setMaterialBoxInfo(m_pCViewInterface);
+    }
+    else
+    {
+        m_mapMaterialBoxMap.value(groupId)->UpdataGenerateTestData();
+    }
+}

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

@@ -9,7 +9,8 @@
 #include "CameraMaterialGroupWnd/CameraImage/CameraImageHandler.h"
 #include <ICalibration.h>
 #include "JOriginalMainWnd.h"
-
+#include <QTimer>
+#include <CViewInterface.h>
 namespace Ui {
 class MainAndSecondaryCamerasWnd;
 }
@@ -40,7 +41,11 @@ public:
 
     //保存信息
     void saveInfoOfLast();
-;
+    void UpdateMaterialByTimer();
+    void UpdateWafer(int groupId);
+    void UpdateWaffle(int groupId);
+    void UpdateBond(int groupId);
+    void UpdateMaterialBox(int groupId);
 
 protected:
     void wheelEvent(QWheelEvent* event) override;
@@ -172,6 +177,8 @@ private:
     const int           m_nCurrentRight = 1;
     const int           m_nImageIndex = 1;
     const int           m_nMaterialIndex = 2;
+    QTimer*             m_timerMaterial;
+    ns_module::CViewInterface* m_pCViewInterface;
 
 };
 

+ 99 - 0
View/die-bonder-ui/OriginalWnd/SingleCameraOperationWnd.cpp

@@ -18,6 +18,9 @@ SingleCameraOperationWnd::SingleCameraOperationWnd(QWidget* parent)
     connect(ui->viewwidgetgroup, &ControlOperationPage::send_ComboBox_singal, this, &SingleCameraOperationWnd::HandleComboxchange);
 
     initFrom();
+    m_timerMaterial = new QTimer(this);
+    connect(m_timerMaterial, &QTimer::timeout, this, &SingleCameraOperationWnd::UpdateMaterialByTimer);
+    m_pCViewInterface = ns_module::CViewInterface::GetInstance();
 }
 
 
@@ -423,6 +426,7 @@ void SingleCameraOperationWnd::initWidget() {
         BindImageOrMaterial(m_nMaterialIndex);
 
     }
+    //m_timerMaterial->start(1000);
 
 }
 
@@ -524,4 +528,99 @@ void SingleCameraOperationWnd::HandleComboxchange(int index) {
         QPixmap updatePixmap = ui->viewwidgetgroup->getCurrentComboBoxPixmap(index);
         m_veCurrentSelectGroup.pSelectGroup->UpDataImageShowSlots(updatePixmap);
     }
+}
+
+void SingleCameraOperationWnd::UpdateMaterialByTimer() {
+    //判断当前大窗口是否是物料窗口
+    if (lastIndex == 2) {
+        QSettings settings("YourOrganization", "YourApplication");
+        settings.beginGroup(QString::number(m_veCurrentSelectGroup.pSelectGroup->m_nGroupId));
+        int MaterialWndType = settings.value("MaterialWndType").toInt();
+        settings.endGroup();
+        switch (MaterialWndType) {
+        case 1:
+        {
+            UpdateWafer(lastGroupId);
+            ui->viewwidgetgroup->setWafer(waferMap.value(lastGroupId));
+            m_allGroup[lastGroupId - 1]->setWaferWidget(ui->viewwidgetgroup->getWafer()->getGlobalPixmap());
+            break;
+        }
+        case 2:
+        {
+            UpdateWaffle(lastGroupId);
+            ui->viewwidgetgroup->setWaffle(waffleMap.value(lastGroupId));
+            m_allGroup[lastGroupId - 1]->setWaffleWidget(ui->viewwidgetgroup->getWaffle()->getGlobalPixmap());
+            break;
+        }
+        case 3:
+        {
+            UpdateMaterialBox(lastGroupId);
+            ui->viewwidgetgroup->setMaterialBox(materialBoxMap.value(lastGroupId));
+            m_allGroup[lastGroupId - 1]->MaterialBoxWidget();
+            break;
+        }
+        case 4:
+        {
+            UpdateBond(lastGroupId);
+            ui->viewwidgetgroup->setBond(bondMap.value(lastGroupId));
+            m_allGroup[lastGroupId - 1]->setBondWidget(ui->viewwidgetgroup->getBond()->getGlobalPixmap());
+            break;
+        }
+        }
+
+    }
+
+}
+
+void SingleCameraOperationWnd::UpdateWafer(int groupId) {
+    if (m_pCViewInterface != nullptr)
+    {
+        std::vector<ns_mat::WAFER_MATRIX_POINT_INFO_STRUCT> veWafer;
+        m_pCViewInterface->GetViewMatrix()->GetWaferAllPointInfo(veWafer);
+        waferMap.value(groupId)->UpdataVal(veWafer);
+        waferMap.value(groupId)->setWaferInfo(m_pCViewInterface);
+    }
+    else
+    {
+        waferMap.value(groupId)->UpdataGenerateTestData();
+    }
+}
+void SingleCameraOperationWnd::UpdateWaffle(int groupId) {
+    if (m_pCViewInterface != nullptr)
+    {
+        std::vector<ns_mat::WAFFLE_MATRIX_POINT_STRUCT> veWaffle;
+        m_pCViewInterface->GetViewMatrix()->GetWafflePackAllPointInfo(veWaffle);
+        waffleMap.value(groupId)->UpdataVal(veWaffle);
+    }
+    else
+    {
+        waffleMap.value(groupId)->UpdataGenerateTestData();
+    }
+}
+void SingleCameraOperationWnd::UpdateBond(int groupId) {
+    if (m_pCViewInterface != nullptr)
+    {
+        std::vector<ns_mat::POINT_INFO_STRUCT> stPointInfo;
+        m_pCViewInterface->GetViewMatrix()->GetBondAllPointInfo(stPointInfo);
+        bondMap.value(groupId)->UpdataVal(stPointInfo);
+        bondMap.value(groupId)->setBondInfo(m_pCViewInterface);
+    }
+    else
+    {
+        bondMap.value(groupId)->UpdataGenerateTestData();
+    }
+}
+void SingleCameraOperationWnd::UpdateMaterialBox(int groupId) {
+    if (m_pCViewInterface != nullptr)
+    {
+        std::vector<ns_module::MATERIAL_BOX_STRUCT> veMaterial;
+
+        m_pCViewInterface->GetViewMatrix()->GetMaterialBoxAllPointInfo(veMaterial);
+        materialBoxMap.value(groupId)->UpdataVal(veMaterial);
+        materialBoxMap.value(groupId)->setMaterialBoxInfo(m_pCViewInterface);
+    }
+    else
+    {
+        materialBoxMap.value(groupId)->UpdataGenerateTestData();
+    }
 }

+ 10 - 0
View/die-bonder-ui/OriginalWnd/SingleCameraOperationWnd.h

@@ -12,6 +12,8 @@
 #include "CameraMaterialGroupWnd/CameraImage/CameraImageHandler.h"
 #include "CameraMaterialGroupWnd/MaterialWindow/DraggableLine.h"
 #include "JOriginalMainWnd.h"
+#include <QTimer>
+#include <CViewInterface.h>
 namespace Ui {
     class SingleCameraOperationWnd;
 }
@@ -38,6 +40,12 @@ public:
 
     void initWidget();
     void UpdataLightJoystickSwitchPage(int groupId, bool isShow);
+
+    void UpdateMaterialByTimer();
+    void UpdateWafer(int groupId);
+    void UpdateWaffle(int groupId);
+    void UpdateBond(int groupId);
+    void UpdateMaterialBox(int groupId);
 public slots: // 确保这里声明了槽函数
 
     QString getImagePathFromIndex(int index);
@@ -110,6 +118,8 @@ private:
     ST_CURRENT_SELECT_GROUP         m_veCurrentSelectGroup;
     const int                       m_nImageIndex = 1;
     const int                       m_nMaterialIndex = 2;
+    QTimer* m_timerMaterial;
+    ns_module::CViewInterface* m_pCViewInterface;
 };
 
 #endif // SINGLECAMERAOPERATIONWND_H