Procházet zdrojové kódy

更新代码:其他两个页面已经同步功能

yun před 3 dny
rodič
revize
455dcfe071

binární
Output/bin/x64/configurations.db


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

@@ -124,7 +124,7 @@ void CameraImageHandler::initGroup(int CameraId)
         if (m_pCViewInterface != nullptr)
         {
             std::vector<ns_mat::WAFFLE_MATRIX_POINT_STRUCT> veWaffle;
-            m_pCViewInterface->GetWafflePackAllPointInfo(veWaffle);
+            //m_pCViewInterface->GetWafflePackAllPointInfo(veWaffle);
             m_pWaffle->UpdataVal(veWaffle);
         }
         else
@@ -266,7 +266,7 @@ QString CameraImageHandler::CreateMaterialType(MATERIAL_TYPE materialType)
             if (m_pCViewInterface != nullptr)
             {
                 std::vector<ns_mat::WAFFLE_MATRIX_POINT_STRUCT> veWaffle;
-                m_pCViewInterface->GetWafflePackAllPointInfo(veWaffle);
+                //m_pCViewInterface->GetWafflePackAllPointInfo(veWaffle);
                 m_pWaffle->UpdataVal(veWaffle);
             }
             else

+ 214 - 97
View/die-bonder-ui/OriginalWnd/ChartsAndCamerasWnd.cpp

@@ -15,7 +15,7 @@
 #include <QMessageBox>
 #include <QPen>
 
-ChartsAndCamerasWnd::ChartsAndCamerasWnd(QWidget *parent) :
+ChartsAndCamerasWnd::ChartsAndCamerasWnd(QWidget* parent) :
     JOriginalMainWnd(parent),
     ui(new Ui::ChartsAndCamerasWnd),
     chartLine(new ChartLine(this)),
@@ -67,7 +67,7 @@ ChartsAndCamerasWnd::ChartsAndCamerasWnd(QWidget *parent) :
 
 
     //isEnable = false;
-    //initFrom();
+    // initFrom();
     isShow = true;
 }
 
@@ -178,7 +178,8 @@ void ChartsAndCamerasWnd::on_CheckBox_clicked()
     // 移除末尾的 "checkBox"
     if (seriesName.endsWith("checkBox")) {
         seriesName.chop(QString("checkBox").length());
-    } else if (seriesName.endsWith("CheckBox")) {
+    }
+    else if (seriesName.endsWith("CheckBox")) {
         seriesName.chop(QString("CheckBox").length());
     }
 
@@ -189,7 +190,7 @@ void ChartsAndCamerasWnd::on_CheckBox_clicked()
         return;
     }
 
-    DataSeries &seriesInfo = m_seriesMap[seriesName];
+    DataSeries& seriesInfo = m_seriesMap[seriesName];
 
     if (checkBox->isChecked()) {
         // 生成随机数据
@@ -216,121 +217,102 @@ void ChartsAndCamerasWnd::on_CheckBox_clicked()
 #endif
 
 void ChartsAndCamerasWnd::initFrom() {
-    // checkSettings();
 
-   
-    QWidget *viewport = ui->scrollArea->viewport();
-    QWidget *container = new QWidget(viewport);
-    QHBoxLayout *layout = new QHBoxLayout(container);
+
+    QWidget* viewport = ui->scrollArea->viewport();
+    QWidget* container = new QWidget(viewport);
+    QHBoxLayout* layout = new QHBoxLayout(container);
 
     layout->setSpacing(16); // 设置Group之间的间隔距离
     layout->setMargin(0);
 
-    QList<int> numbers = {1, 2, 3, 4, 5, 6, 7, 8};
-
-    QList<Group*> widgets;
-
-    for (int i = 0; i < numbers.size(); ++i)
+    //QList<int> numbers = { 1, 2, 3, 4, 5, 6, 7, 8 };
+    int nSize = 0;
+    if (m_pMainCameraBind != nullptr)
     {
-        int num = numbers[i];
-        CameraImageHandler* manager = new CameraImageHandler(num);
-        Group* widget = manager->getGroup();
-        //connect(widget,&Group::send_button_Signal,this,&ChartsAndCamerasWnd::showAndHide);
-        if (widget != nullptr) 
+        nSize = m_pMainCameraBind->m_vecCamera.size();
+        if (nSize == 0) // 针对获取不到的情况
         {
-            CameraConnectUpdateImageFun(i, widget);
-
-            layout->addWidget(widget);
-            widgets.append(widget);
+            nSize = 5;
+            //JMessageTip::Message_warning("a");
         }
-        if(manager->getWafer())
-        {
-            waferMap.insert(num, manager->getWafer());
-        }
-        if(manager->getWafer())
+        QList<int> numbers;
+
+        for (int i = 1; i <= nSize; i++)
         {
-            waffleMap.insert(num, manager->getWaffle());
+            numbers.push_back(i);
         }
-        if(manager->getMaterialBox())
+        for (int i = 0; i < numbers.size(); ++i)
         {
-            materialBoxMap.insert(num,manager->getMaterialBox());
+            int num = numbers[i];
+            CameraImageHandler* manager = new CameraImageHandler(num);
+            Group* widget = manager->getGroup();
+            //connect(widget,&Group::send_button_Signal,this,&ChartsAndCamerasWnd::showAndHide);
+            if (widget != nullptr)
+            {
+                CameraConnectUpdateImageFun(i, widget);
+
+                layout->addWidget(widget);
+                m_allGroup.append(widget);
+            }
+            if (manager->getWafer())
+            {
+                waferMap.insert(num, manager->getWafer());
+            }
+            if (manager->getWaffle())
+            {
+                waffleMap.insert(num, manager->getWaffle());
+            }
+            if (manager->getMaterialBox())
+            {
+                materialBoxMap.insert(num, manager->getMaterialBox());
+            }
+            if (manager->getBond()) {
+                bondMap.insert(num, manager->getBond());
+            }
+
+            delete manager;
         }
-        if (manager->getBond()) {
-            bondMap.insert(num, manager->getBond());
+
+        // 设置控件的最小高度和最大宽度
+        int minHeight = 162;
+        int maxWidth = 244;
+        int num = -16;
+        for (Group* w : m_allGroup) {
+            w->setMinimumHeight(minHeight);
+            w->setMaximumWidth(maxWidth);
+            num = num + 260;
         }
 
-        delete manager;
-    }
+        container->setMinimumSize(num, 162);
+        container->setLayout(layout);
+        ui->scrollArea->setWidget(container);
+        ui->scrollArea->resize(508, 177);
+        initWidget();
 
-    // 设置控件的最小高度和最大宽度
-    int minHeight = 162;
-    int maxWidth = 244;
-    int num = -16;
-    for (Group* w : widgets) {
-        w->setMinimumHeight(minHeight);
-        w->setMaximumWidth(maxWidth);
-        num = num + 260;
     }
-
-    container->setMinimumSize(num, 162);
-    container->setLayout(layout);
-    ui->scrollArea->setWidget(container);
-    ui->scrollArea->resize(508, 177);
-    // checkSettings();
-
 }
 
 
-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();
+void ChartsAndCamerasWnd::checkSettings(int groupId, int index) {
 
     if (groupId != lastGroupId || index != lastIndex) {
+
+        GetCurrentSelectSlots(groupId, index);
         lastGroupId = groupId;
         lastIndex = index;
-        loadSettings();
+        saveInfoOfLast();
+
     }
 }
 
-void ChartsAndCamerasWnd::loadSettings()
-{
-    QSettings settings("YourCompany", "YourApplication_");
-    int groupId = settings.value("GroupId", 0).toInt();
-    int index = settings.value("Index", 0).toInt();
-    loadGroupSettings(groupId, index);
-}
 
-void ChartsAndCamerasWnd::loadGroupSettings(int Id, int Index) {
-    QSettings settings("YourOrganization", "YourApplication");
-    settings.beginGroup(QString::number(Id));
-    QString imagePath = settings.value("ImagePath1").toString();
-    int materialWndType = settings.value("MaterialWndType").toInt();
-    QStringList textList = settings.value("TextList").toStringList();
-    settings.endGroup();
-
-    QPixmap newPixmap;
-    // 判断是实时图片还是物料窗口
-    if (Index == 1) {
-
-        newPixmap = QPixmap(imagePath);
-        
-        ui->viewwidgetgroup->updateOperateWidget(newPixmap);
-        ui->viewwidgetgroup->setEnableControls(true);
-
-    }else if (Index == 2) {
- 
-        updateMaterialWidget(materialWndType, Id);
-        ui->viewwidgetgroup->setEnableControls(false);
-        
-    }
-}
-void ChartsAndCamerasWnd::updateMaterialWidget( int materialWndType, int groupId){
-    
+void ChartsAndCamerasWnd::updateMaterialWidget(int materialWndType, int groupId) {
+
     switch (materialWndType) {
-    case 1: ui->viewwidgetgroup->setWafer(waferMap.value(lastGroupId)); break;
-    case 2: ui->viewwidgetgroup->setWaffle(waffleMap.value(lastGroupId)); break;
-    case 3: ui->viewwidgetgroup->setMaterialBox(materialBoxMap.value(lastGroupId)); break;
+    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;
     }
 
@@ -345,7 +327,10 @@ void ChartsAndCamerasWnd::InitMainCameraBind(CameraBind* pCameraBind)
 
 void ChartsAndCamerasWnd::UnCameraBind()
 {
-
+    for (size_t i = 0; i < m_allGroup.size(); i++)
+    {
+        CameraConnectUpdateImageFun(i, m_allGroup[i], true);
+    }
 }
 
 void ChartsAndCamerasWnd::UpdateCameraDisplay0(int iCameraId, JVision::ImageInfo imageData)
@@ -390,7 +375,7 @@ void ChartsAndCamerasWnd::CameraConnectUpdateImageFun(int nIndex, Group* widget,
         else
         {
             //共用函数
-            connect(widget, &Group::sendUpdateGroupState,this, &ChartsAndCamerasWnd::checkSettings);
+            connect(widget, &Group::sendUpdateGroupState, this, &ChartsAndCamerasWnd::checkSettings);
             connect(this, pCamerasImage, widget, &Group::UpDataImageShowSlots);
         }
 
@@ -418,7 +403,7 @@ void ChartsAndCamerasWnd::CameraConnectUpdateImageFun(int nIndex, Group* widget,
     }
 }
 
-void ChartsAndCamerasWnd::wheelEvent(QWheelEvent *event)
+void ChartsAndCamerasWnd::wheelEvent(QWheelEvent* event)
 {
     //mousePos = ui->viewwidgetgroup->getOperatewidget()->mapFromGlobal(event->globalPos());
 
@@ -443,15 +428,147 @@ void ChartsAndCamerasWnd::wheelEvent(QWheelEvent *event)
     QMainWindow::wheelEvent(event);
 }
 
-void ChartsAndCamerasWnd::showEvent(QShowEvent *event) {
+void ChartsAndCamerasWnd::showEvent(QShowEvent* event) {
     QMainWindow::showEvent(event);
-    loadSettings();
+    // loadSettings();
     // initFrom();
 }
 
-void ChartsAndCamerasWnd::hideEvent(QHideEvent *event) {
+void ChartsAndCamerasWnd::hideEvent(QHideEvent* event) {
     QMainWindow::hideEvent(event);
 }
 
+void ChartsAndCamerasWnd::GetGroupImageShowSignals(const QPixmap& imageData) {
+    QSize size = ui->viewwidgetgroup->getOperatewidget()->size();
+    QPixmap scaledPixmap = imageData.scaled(size, Qt::KeepAspectRatio, Qt::SmoothTransformation);
+    ui->viewwidgetgroup->setScaleFactorSize(scaledPixmap);
+    // m_lastRightPixmap = imageData;
+}
+
+void ChartsAndCamerasWnd::BindImageOrMaterial(int index) {
+
+    if (index == m_nImageIndex) {
+
+        m_veCurrentSelectGroup.isBond = true;
+        connect(m_veCurrentSelectGroup.pSelectGroup, &Group::SetUpDataImageShowSig,
+            this, &ChartsAndCamerasWnd::GetGroupImageShowSignals);
+        UpdataLightJoystickSwitchPage(m_veCurrentSelectGroup.pSelectGroup->m_nGroupId, true);
+
+    }
+    else {
+        QSettings settings("YourOrganization", "YourApplication");
+        settings.beginGroup(QString::number(m_veCurrentSelectGroup.pSelectGroup->m_nGroupId));
+        int materialWndType = settings.value("MaterialWndType").toInt();
+        settings.endGroup();
+        m_veCurrentSelectGroup.isBond = false;
+        UpdataLightJoystickSwitchPage(m_veCurrentSelectGroup.pSelectGroup->m_nGroupId, false);
+        updateMaterialWidget(materialWndType, m_veCurrentSelectGroup.pSelectGroup->m_nGroupId);
+
+    }
+
+}
+
+void ChartsAndCamerasWnd::initWidget() {
+    //初始化当前页面的信息
+
+    QSettings settings("YourOrganization", "YourApplication");
+    lastIndex = settings.value("ChartLastIndex", 1).toInt();
+    lastGroupId = settings.value("ChartLastGroupId", 1).toInt();
+
+    //处理各种情况的初始化
+    if (m_pMainCameraBind == nullptr || m_allGroup.size() == 0)
+    {
+        return;
+    }
+
+    //当lastGroupId大于m_allGroup.size()时,初始化lastGroupId为1
+    if (m_allGroup.size() < lastGroupId) {
+
+        lastGroupId = 1;
+        lastIndex = 1;
+        m_veCurrentSelectGroup.isInitialed = true;
+        m_veCurrentSelectGroup.pSelectGroup = m_allGroup.at(lastGroupId - 1);
+
+        BindImageOrMaterial(m_nImageIndex);
+
+    }
+    else {
+    }
+    m_veCurrentSelectGroup.isInitialed = true;
+    m_veCurrentSelectGroup.pSelectGroup = m_allGroup.at(lastGroupId - 1);
+    if (lastIndex == 1) {
+
+        BindImageOrMaterial(m_nImageIndex);
+
+    }
+    else {
+
+        BindImageOrMaterial(m_nMaterialIndex);
+
+    }
+
+}
+
+void ChartsAndCamerasWnd::saveInfoOfLast() {
+    QSettings settings("YourOrganization", "YourApplication");
+    settings.setValue("ChartLastIndex", lastIndex);
+    settings.setValue("ChartLastGroupId", lastGroupId);
+}
+
+void ChartsAndCamerasWnd::GetCurrentSelectSlots(int groupId, int nIndex) {
+    int nOnClickGroupId = groupId - 1;
+    if (m_pMainCameraBind == nullptr || m_allGroup.size() < groupId)
+    {
+        return;
+    }
+
+    //判断更新前的窗口是否是绑定相机
+    if (m_veCurrentSelectGroup.isBond == true) {
+        //解绑
+        disconnect(m_veCurrentSelectGroup.pSelectGroup, &Group::SetUpDataImageShowSig,
+            this, &ChartsAndCamerasWnd::GetGroupImageShowSignals);
+    }
+    //判断index是相机还是物料
+    if (nIndex == 2) {
+
+        m_veCurrentSelectGroup.pSelectGroup = m_allGroup.at(nOnClickGroupId);
+        BindImageOrMaterial(m_nMaterialIndex);
+
+    }
+    else if (nIndex == 1) {
+        m_veCurrentSelectGroup.pSelectGroup = m_allGroup.at(nOnClickGroupId);
+        BindImageOrMaterial(m_nImageIndex);
+    }
+}
+
+void ChartsAndCamerasWnd::UpdataLightJoystickSwitchPage(int groupId, bool isShow)
+{
+    auto Fun = [&](Group* pGroup, LightJoystickSwitchPage* p, ControlOperationPage* pContPage, bool bShow)
+    {
+        p->UpdatemPageGroup(pGroup);
+        p->InitMainCameraBind(m_pMainCameraBind, bShow);
+        p->HideOrShowPage(bShow);
+        if (bShow)
+        {
+            pContPage->UpDateCameraBind(m_pMainCameraBind);
+        }
+        else
+        {
+            pContPage->setSwitchJoystickButEnable(bShow);
+        }
+
+    };
+
+
+    disconnect(ui->viewwidgetgroup, &ControlOperationPage::SendModuleTypeSignals,
+        ui->control, &LightJoystickSwitchPage::GetModuleTypeSlots);
+    Group* currGroup = m_allGroup.at(groupId - 1);
+    Fun(currGroup, ui->control, ui->viewwidgetgroup, isShow);
+    connect(ui->viewwidgetgroup, &ControlOperationPage::SendModuleTypeSignals,
+        ui->control, &LightJoystickSwitchPage::GetModuleTypeSlots);
+
+
+}
+
 
 

+ 35 - 22
View/die-bonder-ui/OriginalWnd/ChartsAndCamerasWnd.h

@@ -10,10 +10,11 @@
 #include "CameraMaterialGroupWnd/MaterialWindow/Waffle.h"
 #include "CameraMaterialGroupWnd/MaterialWindow/MaterialBox.h"
 #include "JOriginalMainWnd.h"
+#include "CameraDataHandleAndShow.h"
 #include "CameraMaterialGroupWnd/MaterialWindow/Bond.h"
 
 namespace Ui {
-class ChartsAndCamerasWnd;
+    class ChartsAndCamerasWnd;
 }
 
 class ChartsAndCamerasWnd : public JOriginalMainWnd
@@ -21,23 +22,29 @@ class ChartsAndCamerasWnd : public JOriginalMainWnd
     Q_OBJECT
 
 public:
-    explicit ChartsAndCamerasWnd(QWidget *parent = nullptr);
+    explicit ChartsAndCamerasWnd(QWidget* parent = nullptr);
     ~ChartsAndCamerasWnd();
 
     void initFrom();
-    void updateMaterialWidget( int materialWndType, int groupId);
-    
+    void updateMaterialWidget(int materialWndType, int groupId);
+
+    //封装绑定函数
+    void BindImageOrMaterial(int index);
+    //保存信息
+    void saveInfoOfLast();
+
+    void initWidget();
+    void UpdataLightJoystickSwitchPage(int groupId, bool isShow);
+
 protected:
-    void wheelEvent(QWheelEvent *event) override;
-    void loadSettings();
-    void checkSettings(int groupId,int index);
-    void loadGroupSettings(int Id, int Index);
-    void showEvent(QShowEvent *event) override;
-    void hideEvent(QHideEvent *event) override;
+    void wheelEvent(QWheelEvent* event) override;
+    void checkSettings(int groupId, int index);
+    void showEvent(QShowEvent* event) override;
+    void hideEvent(QHideEvent* event) override;
 
 public slots: // 确保这里声明了槽函数
-    
-    
+
+    void GetGroupImageShowSignals(const QPixmap& imageData);
 
 private:
     void InitMainCameraBind(CameraBind* pCameraBind) override;
@@ -51,6 +58,7 @@ private:
 
     void CameraConnectUpdateImageFun(int nIndex, Group* widget, bool isUnCameraBind = false) override;
 
+
 signals:
     void UpDataImageShowSignals0(const QPixmap& imageData);
     void UpDataImageShowSignals1(const QPixmap& imageData);
@@ -59,8 +67,8 @@ signals:
     void UpDataImageShowSignals4(const QPixmap& imageData);
 
 private slots:
-    
 
+    void GetCurrentSelectSlots(int groupId, int nIndex);
     QPixmap getCurrentPixmap() const {
         return currentPixmap;
     }
@@ -91,7 +99,7 @@ private slots:
     // void on_WhiteVerticalBarcheckBox_clicked();
 
 private:
-    Ui::ChartsAndCamerasWnd *ui;
+    Ui::ChartsAndCamerasWnd* ui;
 
     // // 三个 ChartLine 实例
     // ChartLine *chartLine;
@@ -100,9 +108,9 @@ private:
 
 
     // ChartLine 实例
-    ChartLine *chartLine;
-    ChartLine *chartLine1;
-    ChartLine *chartLine2;
+    ChartLine* chartLine;
+    ChartLine* chartLine1;
+    ChartLine* chartLine2;
     // 存储所有系列信息
     QMap<QString, DataSeries> m_seriesMap;
 
@@ -116,9 +124,9 @@ private:
     int lastGroupId = -1;
     int lastIndex = -1;
 
-    Wafer *wafer; // 声明Wafer指针
-    Waffle *waffle; // 声明Waffle指针
-    MaterialBox *materialbox; // 声明materialbox指针
+    Wafer* wafer; // 声明Wafer指针
+    Waffle* waffle; // 声明Waffle指针
+    MaterialBox* materialbox; // 声明materialbox指针
     Bond* bond;
     bool isShow;
 
@@ -127,10 +135,15 @@ private:
     QMap<int, MaterialBox*> materialBoxMap;
     QMap<int, Bond*> bondMap;
     OperateMode currentMode = ModeImage;
-    QGraphicsView *currentView = nullptr;
+    QGraphicsView* currentView = nullptr;
     QPoint mousePos;
-    
+
     QPoint pressPos; // 记录鼠标按下位置
+    QStack<Group*>                  m_allGroup;
+    
+    ST_CURRENT_SELECT_GROUP         m_veCurrentSelectGroup;
+    const int                       m_nImageIndex = 1;
+    const int                       m_nMaterialIndex = 2;
 
 };
 

+ 542 - 67
View/die-bonder-ui/OriginalWnd/DbTreeViewManager.cpp

@@ -1961,6 +1961,47 @@ void DbTreeViewManager::displayThirdLevelFields(const QList<Table_Control_Data>&
     scrollLayout->setSpacing(10);
     scrollLayout->setContentsMargins(10, 10, 10, 10);
 
+    QHBoxLayout* fieldLayout = new QHBoxLayout;
+    fieldLayout->setSpacing(5);
+
+    QPushButton* btnSave = new QPushButton(QStringLiteral("保存"));
+    btnSave->setFixedSize(80, 28);
+    btnSave->setStyleSheet(R"(
+                    QPushButton {
+                        background: #FFFFFF;
+                        border: 1px solid #BABBDC;
+                        border-radius: 5px;
+                    }
+                    QPushButton:hover {
+                        background-color: #F0F0F0;
+                    }
+                )");
+    m_fieldWidgets.append(btnSave);
+
+    connect(btnSave, &QPushButton::clicked, this, [=]() {
+        if (modifiedLabels.isEmpty()) {
+            QMessageBox::information(this, "提示", "没有任何组件被修改!");
+            return;
+        }
+
+        int ret = QMessageBox::question(this, "保存确认", "检测到修改内容,是否保存?",
+            QMessageBox::Yes | QMessageBox::No);
+
+        if (ret == QMessageBox::Yes) {
+            emit saveClicked();
+        }
+        });
+
+    fieldLayout->addWidget(btnSave);
+    scrollLayout->addLayout(fieldLayout);
+
+    QFrame* separator = createUnifiedSeparator(scrollWidget, 2);
+    QHBoxLayout* separatorLayout = new QHBoxLayout;
+    separatorLayout->setContentsMargins(0, 5, 0, 5);
+    separatorLayout->addWidget(separator);
+    scrollLayout->addLayout(separatorLayout);
+    separator->show();
+
     //不同表格的全部插进来
     int previousGroupId = -1;
     QList<CONFIG_BASE_STRUCT> buttonControls;
@@ -1982,6 +2023,7 @@ void DbTreeViewManager::displayThirdLevelFields(const QList<Table_Control_Data>&
                 QString fieldDescribe = QString::fromStdString(control.strDescribe);
                 QString fieldType = QString::fromStdString(control.strType);
                 QString fieldValue = QString::fromStdString(control.strValue);
+                QString fieldDefult = QString::fromStdString(control.strDefult);
                 QString fieldUpLimit = QString::fromStdString(control.strUpperLimit);
                 QString fieldDownLimit = QString::fromStdString(control.strLowerLimit);
                 QString fieldUnits = QString::fromStdString(control.strUnit);
@@ -2095,51 +2137,142 @@ void DbTreeViewManager::displayThirdLevelFields(const QList<Table_Control_Data>&
                         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, 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, lineEdit, fieldUpLimit, fieldDownLimit, label]() {
+							if ((fieldUpLimit != "") && (fieldDownLimit != ""))
+							{
+								int uplimit = fieldUpLimit.toInt();
+								int downlimit = fieldDownLimit.toInt();
+								int inputvalue = (lineEdit->text()).toInt();
+								if ((inputvalue <= uplimit) && (inputvalue >= downlimit))
+								{
+									label->setProperty("value", lineEdit->text());
+									label->setStyleSheet("color: #5c63be;");
+									modifiedLabels.insert(label);
+									// 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)
+								{
+									label->setProperty("value", lineEdit->text());
+									label->setStyleSheet("color: #5c63be;");
+									modifiedLabels.insert(label);
+									// 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)
+								{
+									label->setProperty("value", lineEdit->text());
+									label->setStyleSheet("color: #5c63be;");
+									modifiedLabels.insert(label);
+									// m_sqlOper->updateControlData(fieldTableName, fieldName, lineEdit->text());
+									//updateDb(fieldTableName, fieldId, lineEdit->text());
+								}
+								else
+								{
+									lineEdit->setPlaceholderText(tr("超出设定范围,请重新输入"));
+								}
+							}
+							else
+							{
+								label->setProperty("value", lineEdit->text());
+								label->setStyleSheet("color: #5c63be;");
+								modifiedLabels.insert(label);
+								// m_sqlOper->updateControlData(fieldTableName, fieldName, lineEdit->text());
+								//updateDb(fieldTableName, fieldId, lineEdit->text());
+							}
+
+							});
+
+						connect(this, &DbTreeViewManager::saveClicked, [this, fieldTableName, fieldName, label]() {
+							if (modifiedLabels.contains(label)) {
+								m_sqlOper->updateControlData(fieldTableName, fieldName, label->property("value").toString());
+								label->setStyleSheet("color: black;");
+								modifiedLabels.remove(label);
+							}
+							});
+
+						QPushButton* btnDefault = new QPushButton(QStringLiteral("默认"));
+						btnDefault->setFixedSize(60, 28);
+						btnDefault->setStyleSheet(R"(
+                            QPushButton {
+                                background: #FFFFFF;
+                                border: 1px solid #BABBDC;
+                                border-radius: 5px;
                             }
-
-                            });
+                            QPushButton:hover {
+                                background-color: #F0F0F0;
+                            }
+                        )");
+						rightLayout->addWidget(btnDefault);
+
+						connect(btnDefault, &QPushButton::clicked, [this, fieldDefult, lineEdit]() {
+							if (!fieldDefult.isEmpty()) {
+								lineEdit->setText(fieldDefult);
+							}
+							});
                     } 
                     else
                     {
@@ -2159,10 +2292,47 @@ void DbTreeViewManager::displayThirdLevelFields(const QList<Table_Control_Data>&
                         rightLayout->addWidget(lineEdit1);
                         createdWidget = lineEdit1;
                         // // 连接 textChanged 信号到 lambda 函数
-                        connect(lineEdit1, &QLineEdit::textChanged, [this, lineEdit1, fieldTableName, fieldName]() {
-                            m_sqlOper->updateControlData(fieldTableName, fieldName, lineEdit1->text());
+                        //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, label]() {
+                            label->setProperty("value", lineEdit1->text());
+                            label->setStyleSheet("color: #5c63be;");
+                            modifiedLabels.insert(label);
+                            // m_sqlOper->updateControlData(fieldTableName, fieldName, lineEdit1->text());
                             //updateDb(fieldTableName, fieldId, lineEdit1->text());
-                            loginput(fieldTableName, fieldName, lineEdit1->text());
+                            // loginput(fieldTableName, fieldName, lineEdit1->text());
+                            });
+
+                        connect(this, &DbTreeViewManager::saveClicked, [this, fieldTableName, fieldName, label]() {
+                            if (modifiedLabels.contains(label)) {
+                                m_sqlOper->updateControlData(fieldTableName, fieldName, label->property("value").toString());
+                                loginput(fieldTableName, fieldName, label->property("value").toString());
+                                label->setStyleSheet("color: black;");
+                                modifiedLabels.remove(label);
+                            }
+                            });
+
+                        QPushButton* btnDefault = new QPushButton(QStringLiteral("默认"));
+                        btnDefault->setFixedSize(60, 28);
+                        btnDefault->setStyleSheet(R"(
+                            QPushButton {
+                                background: #FFFFFF;
+                                border: 1px solid #BABBDC;
+                                border-radius: 5px;
+                            }
+                            QPushButton:hover {
+                                background-color: #F0F0F0;
+                            }
+                        )");
+                        rightLayout->addWidget(btnDefault);
+
+                        connect(btnDefault, &QPushButton::clicked, [this, fieldDefult, lineEdit1]() {
+                            if (!fieldDefult.isEmpty()) {
+                                lineEdit1->setText(fieldDefult);
+                            }
                             });
                     }
                 } 
@@ -2187,15 +2357,60 @@ void DbTreeViewManager::displayThirdLevelFields(const QList<Table_Control_Data>&
                         }
                     }
                     // 使用Lambda函数连接 buttonToggled 信号
-                    connect(radioGroup, static_cast<void (QButtonGroup::*)(QAbstractButton*, bool)>(&QButtonGroup::buttonToggled), [this, fieldTableName, fieldName](QAbstractButton* button, bool checked) {
+                    //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, label](QAbstractButton* button, bool checked) {
                         if (checked)
                         {
+                            label->setProperty("value", button->text());
+                            label->setStyleSheet("color: #5c63be;");
+                            modifiedLabels.insert(label);
                             // qDebug() << "Button toggled:" << button->text();
                             // 在这里添加你想要执行的操作
-                            m_sqlOper->updateControlData(fieldTableName, fieldName, button->text());
+                            // m_sqlOper->updateControlData(fieldTableName, fieldName, button->text());
                             //updateDb(fieldTableName, fieldId, button->text());
                         }
                         });
+
+                    connect(this, &DbTreeViewManager::saveClicked, [this, fieldTableName, fieldName, label]() {
+                        if (modifiedLabels.contains(label)) {
+                            m_sqlOper->updateControlData(fieldTableName, fieldName, label->property("value").toString());
+                            label->setStyleSheet("color: black;");
+                            modifiedLabels.remove(label);
+                        }
+                        });
+
+                    QPushButton* btnDefault = new QPushButton(QStringLiteral("默认"));
+                    btnDefault->setFixedSize(60, 28);
+                    btnDefault->setStyleSheet(R"(
+                            QPushButton {
+                                background: #FFFFFF;
+                                border: 1px solid #BABBDC;
+                                border-radius: 5px;
+                            }
+                            QPushButton:hover {
+                                background-color: #F0F0F0;
+                            }
+                        )");
+                    rightLayout->addWidget(btnDefault);
+
+                    connect(btnDefault, &QPushButton::clicked, [this, fieldDefult, radioGroup]() {
+                        if (!fieldDefult.isEmpty()) {
+                            for (QAbstractButton* button : radioGroup->buttons()) {
+                                if (button->text() == fieldDefult) {
+                                    button->setChecked(true);
+                                    break;
+                                }
+                            }
+                        }
+                        });
                     rightLayout->addLayout(radioLayout);
                 } 
                 else if (fieldType == "checkbox" || fieldType == "BOOL")
@@ -2230,28 +2445,93 @@ void DbTreeViewManager::displayThirdLevelFields(const QList<Table_Control_Data>&
                 )");
                     rightLayout->addWidget(checkBox);
                     createdWidget = checkBox;
-                    connect(checkBox, &QCheckBox::stateChanged, [this, fieldTableName, fieldName](int state) {
+                    //connect(checkBox, &QCheckBox::stateChanged, [this, fieldTableName, fieldName](int state) {
+                    //    if (state == Qt::Checked)
+                    //    {
+                    //        // qDebug() << "CheckBox is checked"<<fieldId;
+                    //        m_sqlOper->updateControlData(fieldTableName, fieldName, "1");
+                    //        //updateDb(fieldTableName, fieldId, "1");
+                    //    } else if (state == Qt::Unchecked)
+                    //    {
+                    //        // qDebug() << "CheckBox is unchecked"<<fieldId;
+                    //        // 在这里添加你想要执行的操作
+                    //        m_sqlOper->updateControlData(fieldTableName, fieldName, "0");
+                    //        //updateDb(fieldTableName, fieldId, "0");
+                    //    } else if (state == Qt::PartiallyChecked)
+                    //    {
+                    //        qDebug() << "CheckBox is partially checked";
+                    //        // 在这里添加你想要执行的操作
+                    //    }
+                    //    });
+                    connect(checkBox, &QCheckBox::stateChanged, [this, label](int state) {
                         if (state == Qt::Checked)
                         {
                             // qDebug() << "CheckBox is checked"<<fieldId;
-                            m_sqlOper->updateControlData(fieldTableName, fieldName, "1");
+                            // m_sqlOper->updateControlData(fieldTableName, fieldName, "1");
                             //updateDb(fieldTableName, fieldId, "1");
-                        } else if (state == Qt::Unchecked)
+                            label->setProperty("value", "1");
+                            label->setStyleSheet("color: #5c63be;");
+                            modifiedLabels.insert(label);
+                        }
+                        else if (state == Qt::Unchecked)
                         {
                             // qDebug() << "CheckBox is unchecked"<<fieldId;
                             // 在这里添加你想要执行的操作
-                            m_sqlOper->updateControlData(fieldTableName, fieldName, "0");
+                            // m_sqlOper->updateControlData(fieldTableName, fieldName, "0");
                             //updateDb(fieldTableName, fieldId, "0");
-                        } else if (state == Qt::PartiallyChecked)
+                            label->setProperty("value", "0");
+                            label->setStyleSheet("color: #5c63be;");
+                            modifiedLabels.insert(label);
+                        }
+                        else if (state == Qt::PartiallyChecked)
                         {
                             qDebug() << "CheckBox is partially checked";
                             // 在这里添加你想要执行的操作
                         }
                         });
+
+                    connect(this, &DbTreeViewManager::saveClicked, [this, fieldTableName, fieldName, label]() {
+                        if (modifiedLabels.contains(label)) {
+                            m_sqlOper->updateControlData(fieldTableName, fieldName, label->property("value").toString());
+                            label->setStyleSheet("color: black;");
+                            modifiedLabels.remove(label);
+                        }
+                        });
+
+                    QPushButton* btnDefault = new QPushButton(QStringLiteral("默认"));
+                    btnDefault->setFixedSize(60, 28);
+                    btnDefault->setStyleSheet(R"(
+                            QPushButton {
+                                background: #FFFFFF;
+                                border: 1px solid #BABBDC;
+                                border-radius: 5px;
+                            }
+                            QPushButton:hover {
+                                background-color: #F0F0F0;
+                            }
+                        )");
+                    rightLayout->addWidget(btnDefault);
+
+                    connect(btnDefault, &QPushButton::clicked, [this, fieldDefult, checkBox]() {
+                        if (!fieldDefult.isEmpty()) {
+                            if (fieldDefult == "1") {
+                                checkBox->setChecked(true);
+                            }
+                            else {
+                                checkBox->setChecked(false);
+                            }
+                        }
+                        });
                 } 
                 else if (fieldType == "ComboBox")
                 {
-                    QStringList optionList = fieldValue.split(QRegExp("[,,]"), Qt::SkipEmptyParts);
+                    //QStringList optionList = fieldValue.split(QRegExp("[,,]"), Qt::SkipEmptyParts);
+                    QJsonArray jsonArray;
+                    QJsonParseError parseError;
+                    QJsonDocument jsonDoc = QJsonDocument::fromJson(fieldUnits.toUtf8(), &parseError);
+                    if (!jsonDoc.isNull() && jsonDoc.isArray()) {
+                        jsonArray = jsonDoc.array();
+                    }
                     QComboBox* comboBox = new QComboBox;
                     comboBox->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
                     comboBox->setFixedSize(140, 28);
@@ -2267,7 +2547,7 @@ void DbTreeViewManager::displayThirdLevelFields(const QList<Table_Control_Data>&
                     }
                 )");
                     // int newIndex = -1;
-                    for (const QString& opt : optionList)
+                    /*for (const QString& opt : optionList)
                     {
                         QString trimmedOpt = opt.trimmed();
                         if (!trimmedOpt.isEmpty())
@@ -2279,17 +2559,91 @@ void DbTreeViewManager::displayThirdLevelFields(const QList<Table_Control_Data>&
                     } else
                     {
                         comboBox->setCurrentIndex(fieldValue.toInt());
+                    }*/
+                    int matchedIndex = -1;
+                    int currentIndex = 0;
+
+                    for (const QJsonValue& val : jsonArray) {
+                        QJsonObject obj = val.toObject();
+                        QString key = obj["key"].toString();
+                        QString valueStr = QString::number(obj["value"].toInt()); // 统一转字符串对比
+
+                        comboBox->addItem(key);
+
+                        if (valueStr == fieldValue.trimmed()) {
+                            matchedIndex = currentIndex;
+                        }
+                        currentIndex++;
                     }
+                    comboBox->setCurrentIndex(matchedIndex != -1 ? matchedIndex : 0);
                     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, 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, label](int index) {
+                            QString selectedText = comboBox->itemText(index);
+                            QString valueString;
+                            for (const QJsonValue& val : jsonArray) {
+                                QJsonObject obj = val.toObject();
+                                if (obj["key"].toString() == selectedText) {
+                                    valueString = QString::number(obj["value"].toInt());
+                                    break;
+                                }
+                            }
+                            // m_sqlOper->updateControlData(fieldTableName, fieldName, valueString);
+                            label->setProperty("value", valueString);
+                            label->setStyleSheet("color: #5c63be;");
+                            modifiedLabels.insert(label);
+                        });
+
+                    connect(this, &DbTreeViewManager::saveClicked, [this, fieldTableName, fieldName, label]() {
+                        if (modifiedLabels.contains(label)) {
+                            m_sqlOper->updateControlData(fieldTableName, fieldName, label->property("value").toString());
+                            label->setStyleSheet("color: black;");
+                            modifiedLabels.remove(label);
+                        }
+                        });
+
+                    QPushButton* btnDefault = new QPushButton(QStringLiteral("默认"));
+                    btnDefault->setFixedSize(60, 28);
+                    btnDefault->setStyleSheet(R"(
+                            QPushButton {
+                                background: #FFFFFF;
+                                border: 1px solid #BABBDC;
+                                border-radius: 5px;
+                            }
+                            QPushButton:hover {
+                                background-color: #F0F0F0;
+                            }
+                        )");
+                    rightLayout->addWidget(btnDefault);
+
+                    connect(btnDefault, &QPushButton::clicked, [this, fieldDefult, comboBox, jsonArray]() {
+                        if (!fieldDefult.isEmpty()) {
+                            int matchedIndex = -1;
+                            int currentIndex = 0;
+
+                            for (const QJsonValue& val : jsonArray) {
+                                QJsonObject obj = val.toObject();
+                                QString key = obj["key"].toString();
+                                QString valueStr = QString::number(obj["value"].toInt());
+
+                                if (valueStr == fieldDefult.trimmed()) {
+                                    matchedIndex = currentIndex;
+                                    break;
+                                }
+                                currentIndex++;
+                            }
+                            comboBox->setCurrentIndex(matchedIndex != -1 ? matchedIndex : 0);
+                        }
                         });
                 } else if (fieldType == "time")
                 {
@@ -2308,6 +2662,40 @@ void DbTreeViewManager::displayThirdLevelFields(const QList<Table_Control_Data>&
                     timeEdit->setTime(QTime::fromString(fieldValue, "HH:mm:ss"));
                     rightLayout->addWidget(timeEdit);
                     createdWidget = timeEdit;
+                    connect(timeEdit, &QTimeEdit::timeChanged, [this, timeEdit, label]() {
+                        QString timeString = timeEdit->time().toString("HH:mm:ss");
+                        label->setProperty("value", timeString);
+                        label->setStyleSheet("color: #5c63be;");
+                        modifiedLabels.insert(label);
+                        });
+
+                    connect(this, &DbTreeViewManager::saveClicked, [this, fieldTableName, fieldName, label]() {
+                        if (modifiedLabels.contains(label)) {
+                            m_sqlOper->updateControlData(fieldTableName, fieldName, label->property("value").toString());
+                            label->setStyleSheet("color: black;");
+                            modifiedLabels.remove(label);
+                        }
+                        });
+
+                    QPushButton* btnDefault = new QPushButton(QStringLiteral("默认"));
+                    btnDefault->setFixedSize(60, 28);
+                    btnDefault->setStyleSheet(R"(
+                            QPushButton {
+                                background: #FFFFFF;
+                                border: 1px solid #BABBDC;
+                                border-radius: 5px;
+                            }
+                            QPushButton:hover {
+                                background-color: #F0F0F0;
+                            }
+                        )");
+                    rightLayout->addWidget(btnDefault);
+
+                    connect(btnDefault, &QPushButton::clicked, [this, fieldDefult, timeEdit]() {
+                        if (!fieldDefult.isEmpty()) {
+                            timeEdit->setTime(QTime::fromString(fieldDefult, "HH:mm:ss"));
+                        }
+                        });
                 } else if (fieldType == "switch")
                 {
                     QWidget* switchContainer = new QWidget;
@@ -2347,19 +2735,74 @@ void DbTreeViewManager::displayThirdLevelFields(const QList<Table_Control_Data>&
                     QLabel* switchLabel = new QLabel(switchBox->isChecked() ? tr("开") :tr("关"));
                     switchLabel->setAlignment(Qt::AlignVCenter | Qt::AlignLeft);
                     switchLabel->setStyleSheet("font-size: 14px;");
-                    connect(switchBox, &QCheckBox::stateChanged, [fieldTableName, fieldName, switchLabel, this](int state) {
+                    //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, label](int state) {
                         if (state == Qt::Checked)
                         {
                             switchLabel->setText(tr("开"));
-                            m_sqlOper->updateControlData(fieldTableName, fieldName, "on");
+                            label->setProperty("value", "on");
+                            label->setStyleSheet("color: #5c63be;");
+                            modifiedLabels.insert(label);
+                            // m_sqlOper->updateControlData(fieldTableName, fieldName, "on");
                             //updateDb(fieldTableName, fieldId, "on");
-                        } else
+                        }
+                        else
                         {
                             switchLabel->setText(tr("关"));
-                            m_sqlOper->updateControlData(fieldTableName, fieldName, "off");
+                            label->setProperty("value", "off");
+                            label->setStyleSheet("color: #5c63be;");
+                            modifiedLabels.insert(label);
+                            // m_sqlOper->updateControlData(fieldTableName, fieldName, "off");
                             //updateDb(fieldTableName, fieldId, "off");
                         }
                         });
+
+                    connect(this, &DbTreeViewManager::saveClicked, [this, fieldTableName, fieldName, label]() {
+                        if (modifiedLabels.contains(label)) {
+                            m_sqlOper->updateControlData(fieldTableName, fieldName, label->property("value").toString());
+                            label->setStyleSheet("color: black;");
+                            modifiedLabels.remove(label);
+                        }
+                        });
+
+                    QPushButton* btnDefault = new QPushButton(QStringLiteral("默认"));
+                    btnDefault->setFixedSize(60, 28);
+                    btnDefault->setStyleSheet(R"(
+                            QPushButton {
+                                background: #FFFFFF;
+                                border: 1px solid #BABBDC;
+                                border-radius: 5px;
+                            }
+                            QPushButton:hover {
+                                background-color: #F0F0F0;
+                            }
+                        )");
+                    rightLayout->addWidget(btnDefault);
+
+                    connect(btnDefault, &QPushButton::clicked, [this, fieldDefult, switchBox, switchLabel]() {
+                        if (!fieldDefult.isEmpty()) {
+                            if (fieldDefult == "on") {
+                                switchBox->setChecked(true);
+                                switchLabel->setText(tr("开"));
+                            }
+                            else {
+                                switchBox->setChecked(false);
+                                switchLabel->setText(tr("关"));
+                            }
+                        }
+                        });
                     switchLayout->addWidget(switchBox);
                     switchLayout->addWidget(switchLabel);
                     rightLayout->addWidget(switchContainer);
@@ -2499,7 +2942,39 @@ void DbTreeViewManager::displayThirdLevelFields(const QList<Table_Control_Data>&
 
                     m_veCombinedCont.push_back(_a);
 
+                    connect(comboInput, &QLineEdit::textChanged, [this, comboInput, label]() {
+                        label->setProperty("value", comboInput->text());
+                        label->setStyleSheet("color: #5c63be;");
+                        modifiedLabels.insert(label);
+                        });
 
+                    connect(this, &DbTreeViewManager::saveClicked, [this, fieldTableName, fieldName, label]() {
+                        if (modifiedLabels.contains(label)) {
+                            m_sqlOper->updateControlData(fieldTableName, fieldName, label->property("value").toString());
+                            label->setStyleSheet("color: black;");
+                            modifiedLabels.remove(label);
+                        }
+                        });
+
+                    QPushButton* btnDefault = new QPushButton(QStringLiteral("默认"));
+                    btnDefault->setFixedSize(60, 28);
+                    btnDefault->setStyleSheet(R"(
+                            QPushButton {
+                                background: #FFFFFF;
+                                border: 1px solid #BABBDC;
+                                border-radius: 5px;
+                            }
+                            QPushButton:hover {
+                                background-color: #F0F0F0;
+                            }
+                        )");
+                    rightLayout->addWidget(btnDefault);
+
+                    connect(btnDefault, &QPushButton::clicked, [this, fieldDefult, comboInput]() {
+                        if (!fieldDefult.isEmpty()) {
+                            comboInput->setText(fieldDefult);
+                        }
+                        });
 
                 } else if (fieldType == "Text")
                 {

+ 2 - 0
View/die-bonder-ui/OriginalWnd/DbTreeViewManager.h

@@ -142,6 +142,7 @@ public:
     QStandardItem* deepCopyItem(const QStandardItem* item);
 signals:
     void RunFunSignals(ns_module::ST_BUTTON_FUN pra);
+    void saveClicked();
 
 
 private slots:
@@ -288,6 +289,7 @@ private:
     std::vector<ST_COMBINED_CONT> m_veCombinedCont;
     ns_module::CViewInterface* m_pTreeCViewInterface;
     QString m_strModuleTypeAAA;
+    QSet<QLabel*> modifiedLabels;
 private:
 
     //  每次切换控制屏幕时,清空历史

+ 70 - 289
View/die-bonder-ui/OriginalWnd/MainAndSecondaryCamerasWnd.cpp

@@ -16,15 +16,7 @@ MainAndSecondaryCamerasWnd::MainAndSecondaryCamerasWnd(QWidget *parent)
 {
     ui->setupUi(this);
 
-    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();
-    lastLastIndex = settings.value("LastLastIndex", 0).toInt();
-    lastLastGroupId = settings.value("LastLastGroupId", 0).toInt();
-    settings.endGroup();
+
 
     QString buildDirPath = QCoreApplication::applicationDirPath();
     QDir buildDirectory(buildDirPath);
@@ -214,41 +206,41 @@ void MainAndSecondaryCamerasWnd::CameraConnectUpdateImageFun(int nIndex, Group*
 
 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();
-
-    // 注册表里面没有默认值,下面2个
-    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;
+
+    lastLastIndex = settings.value("DoubleLastLastIndex", 2).toInt();
+    lastLastGroupId = settings.value("DoubleLastLastGroupId", 1).toInt();
+
+
+
+    lastIndex = settings.value("DoubleLastIndex", 1).toInt();
+    lastGroupId = settings.value("DoubleLastGroupId", 1).toInt();
+
 
     //处理各种情况的初始化
-    if (m_pMainCameraBind == nullptr || m_allGroup.size() < lastGroupId || m_allGroup.size() == 0)
+    if (m_pMainCameraBind == nullptr || m_allGroup.size() == 0)
     {
         return;
     }
+    if (m_allGroup.size() < lastGroupId) {
+        //重置记录
+        lastGroupId = 1;
+        lastIndex = 1;
+        lastLastGroupId = 1;
+        lastLastGroupId = 2;
+        
+    }
+    m_veCurrentSelectGroup_R.isInitialed = true;
+    m_veCurrentSelectGroup_L.isInitialed = true;
 
     if (m_allGroup.size() == 1) {
-        if (LastGroup != lastLastGroupId || LastGroup == lastLastGroupId){
-            m_veCurrentSelectGroup_R.isInitialed = true;
-            m_veCurrentSelectGroup_L.isInitialed = true;
+        if (lastIndex != lastLastIndex) {
+
             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);
@@ -259,15 +251,17 @@ void MainAndSecondaryCamerasWnd::initLeftAndRightWidget() {
 
             }
 
-        }else {
+        }
+        else {
+            BindImageOrMaterial(m_nCurrentRight, m_nMaterialIndex);
+            BindImageOrMaterial(m_nLastLeft, m_nImageIndex);
 
         }
-    }else {
     }
-        m_veCurrentSelectGroup_R.isInitialed = true;
-        m_veCurrentSelectGroup_L.isInitialed = true;
+    else {
+
         m_veCurrentSelectGroup_L.pSelectGroup = m_allGroup.at(lastLastGroupId - 1);
-        m_veCurrentSelectGroup_R.pSelectGroup = m_allGroup.at(lastGroupId -1);
+        m_veCurrentSelectGroup_R.pSelectGroup = m_allGroup.at(lastGroupId - 1);
         if (lastLastIndex == 1) {
 
             BindImageOrMaterial(m_nLastLeft, m_nImageIndex);
@@ -285,12 +279,11 @@ void MainAndSecondaryCamerasWnd::initLeftAndRightWidget() {
         }
         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) {
@@ -353,81 +346,16 @@ void MainAndSecondaryCamerasWnd::checkSettings(int groupId,int 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)
-{
-
-    QSettings settings("YourOrganization", "YourApplication");
-    settings.beginGroup(QString::number(Id));
-    QString imagePath = settings.value("ImagePath1").toString();
-    int materialWndType = settings.value("MaterialWndType").toInt();
-    QStringList textList = settings.value("TextList").toStringList();
-    settings.endGroup();
-    QSettings Last_settings("YourOrganization", "YourApplication");
-    settings.beginGroup(QString::number(lastGroupId));
-    QString Last_imagePath = settings.value("ImagePath1").toString();
-    int Last_materialWndType = settings.value("MaterialWndType").toInt();
-    QStringList Last_textList = settings.value("TextList").toStringList();
-    settings.endGroup();
-    QString lastRightImage = settings.value("LastRightImage").toString();
-
-
-    QPixmap newPixmap;
-    QPixmap Last_newPixmap;
-
-    if (Index == 1) 
-    {
-        newPixmap = QPixmap(imagePath);
-        
-        ui->viewwidgetgroup_R->updateOperateWidget(newPixmap);
-        ui->viewwidgetgroup_R->setEnableControls(true);
-    }
+    settings.setValue("DoubleLastIndex", lastIndex);
+    settings.setValue("DoubleLastGroupId", lastGroupId);
 
-    if (lastIndex == 1) 
-    {
-        
-        Last_newPixmap = QPixmap(Last_imagePath);
-        
-        ui->viewwidgetgroup_L->updateOperateWidget(Last_newPixmap);
-        ui->viewwidgetgroup_L->setEnableControls(true);
-    }
-    else if (lastIndex == 2) 
-    {
-        updateMaterialWidget(m_nLastLeft,Last_materialWndType, lastGroupId);
-        ui->viewwidgetgroup_L->setEnableControls(false);
-    }
-    
-    if (Index == 2) 
-    {
-        updateMaterialWidget(m_nCurrentRight,materialWndType, Id); 
-        ui->viewwidgetgroup_R->setEnableControls(false);
-    }
-
-    QSettings settings2("YourOrganization", "YourApplication_lastWndType");
-    settings2.setValue("LastWndType", lastIndex);
-    settings2.setValue("LastGroup", lastGroupId);
+    settings.setValue("DoubleLastLastIndex", lastLastIndex);
+    settings.setValue("DoubleLastLastGroupId", lastLastGroupId);
 
+}
 
 
-    QPixmap scaledPixmap_right = newPixmap.scaled(ui->viewwidgetgroup_R->getOperatewidget()->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
-    if (isUpdatingSettings) {
-        lastLastRightPixmap = m_lastRightPixmap;
-        lastLasttextList = lasttextList;
-        m_lastRightPixmap = scaledPixmap_right;
-        lasttextList = textList;
-        lastLastIndex = lastIndex;
-        lastLastGroupId = lastGroupId;
-    }
-}
 void MainAndSecondaryCamerasWnd::updateMaterialWidget(int  side,int materialWndType, int groupId) {
     if (side == m_nLastLeft) {
         switch (materialWndType) {
@@ -576,73 +504,52 @@ void MainAndSecondaryCamerasWnd::timerEvent(QTimerEvent* event)
 
 void MainAndSecondaryCamerasWnd::GetCurrentSelectSlots(int groupId, int nIndex)
 {
-    int nOnClickGroupId = groupId -1; // 这里new 有些是0,有些是1 暂时选择
+    int nOnClickGroupId = groupId - 1; // 这里new 有些是0,有些是1 暂时选择
     if (m_pMainCameraBind == nullptr || m_allGroup.size() < groupId)
     {
         return;
     }
 
-    //判断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);
+    //判断更新前的左窗口是否是绑定相机
+    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;
-            BindImageOrMaterial(m_nLastLeft, m_nImageIndex);
+    m_veCurrentSelectGroup_L = m_veCurrentSelectGroup_R;
+    //判断更新前的右窗口的index是相机还是物料
+    if (lastIndex == 1) {
+        //左窗口绑定
 
-        }
-        else {
+        BindImageOrMaterial(m_nLastLeft, m_nImageIndex);
 
-            BindImageOrMaterial(m_nLastLeft, m_nMaterialIndex);
-
-        }
-        //右边更新物料窗口
-        m_veCurrentSelectGroup_R.pSelectGroup = m_allGroup.at(nOnClickGroupId);
-        BindImageOrMaterial(m_nCurrentRight, m_nMaterialIndex);
+    }
+    else {
 
-    }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;
+        BindImageOrMaterial(m_nLastLeft, m_nMaterialIndex);
 
-            //换绑
-            //左窗口绑定
-            m_veCurrentSelectGroup_L = m_veCurrentSelectGroup_R;
-            BindImageOrMaterial(m_nLastLeft, m_nImageIndex);
+    }
+    //右边更新物料窗口
+    m_veCurrentSelectGroup_R.pSelectGroup = m_allGroup.at(nOnClickGroupId);
+    //判断当前index是相机还是物料
+    if (nIndex == 2) {
 
-        }
-        else {
+        BindImageOrMaterial(m_nCurrentRight, m_nMaterialIndex);
 
-            //左边更新物料窗口
-            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);
+    }
+    else if (nIndex == 1) {//当前切换时相机序号
 
-        }
-        //右窗口更新相机窗口
-        m_veCurrentSelectGroup_R.pSelectGroup = m_allGroup.at(nOnClickGroupId);
         BindImageOrMaterial(m_nCurrentRight, m_nImageIndex);
-
     }
+
+
 }
 
 void MainAndSecondaryCamerasWnd::GetGroupImageShowSignalsTo_L(const QPixmap& imageData)
@@ -667,132 +574,7 @@ void MainAndSecondaryCamerasWnd::GetGroupImageShowSignalsTo_R(const QPixmap& ima
     m_lastRightPixmap = imageData;
 }
 
-#if 0
-void MainAndSecondaryCamerasWnd::GetCurrentSelectSlots(int groupId, int nIndex)
-{
-
-    int nOnClickGroupId = groupId - 1; // 这里new 有些是0,有些是1 暂时选择
-    if (m_pMainCameraBind == nullptr || m_allGroup.size() < nOnClickGroupId)
-    {
-        return;
-    }
-
-    // 绑定操作,用来初始化
-    ST_CURRENT_SELECT_GROUP _curr;
-    _curr.isBond = true;
-    if (m_pMainCameraBind->m_vecCamera.size() > nOnClickGroupId)
-    {
-        _curr.nCurrentCameraId = m_pMainCameraBind->m_vecCamera[nOnClickGroupId].iCameraId;
-    }
-    else
-    {
-        _curr.nCurrentCameraId = 0;
-    }
-
-    _curr.nSelectLeft1 = nIndex; // 是否选中窗口
-
-    Group* pGroup = m_allGroup.at(nOnClickGroupId);
-    _curr.pSelectGroup = pGroup;
-
-    // 1.判断当前是否存储
-    if (m_veCurrentSelectGroup.size() >= 2)
-    {
-        if (pGroup == m_veCurrentSelectGroup[1].pSelectGroup && 
-            m_veCurrentSelectGroup[1].nSelectLeft1== nIndex)
-        {
-            return;
-        }
-        // 解绑操作,删除第0个 ,, 主要目前为了实现 相机切换
-        disconnect(m_veCurrentSelectGroup[0].pSelectGroup, &Group::SetUpDataImageShowSig,
-            this, &MainAndSecondaryCamerasWnd::GetUpDataImageShowSignals0);
-        disconnect(m_veCurrentSelectGroup[0].pSelectGroup, &Group::SetUpDataImageShowSig,
-            this, &MainAndSecondaryCamerasWnd::GetUpDataImageShowSignals4);
-        disconnect(m_veCurrentSelectGroup[1].pSelectGroup, &Group::SetUpDataImageShowSig,
-            this, &MainAndSecondaryCamerasWnd::GetUpDataImageShowSignals0);
-        disconnect(m_veCurrentSelectGroup[1].pSelectGroup, &Group::SetUpDataImageShowSig,
-            this, &MainAndSecondaryCamerasWnd::GetUpDataImageShowSignals4);
-
 
-        m_veCurrentSelectGroup.erase(m_veCurrentSelectGroup.begin() + 0);// 0个
-
-        if (m_veCurrentSelectGroup[0].nSelectLeft1 == 1)
-        {
-            connect(m_veCurrentSelectGroup[0].pSelectGroup, &Group::SetUpDataImageShowSig,
-                this, &MainAndSecondaryCamerasWnd::GetUpDataImageShowSignals0);
-
-            // 在绑定
-            connect(pGroup, &Group::SetUpDataImageShowSig,
-                this, &MainAndSecondaryCamerasWnd::GetUpDataImageShowSignals4);
-        }
-        else
-        {
-            // 直接复制图片?
-            if (_curr.nSelectLeft1 == 1)
-            {
-                connect(m_veCurrentSelectGroup[0].pSelectGroup, &Group::SetUpDataImageShowSig,
-                    this, &MainAndSecondaryCamerasWnd::GetUpDataImageShowSignals4);
-            }
-            else
-            {
-                //loadGroupSettings(groupId, nIndex);
-            }
-        }
-        
-        m_veCurrentSelectGroup.push_back(_curr); 
-        UpdataLightJoystickSwitchPage();
-    }
-    else
-    {
-        if (m_veCurrentSelectGroup.size() > 0)
-        {
-            if (m_veCurrentSelectGroup[0].pSelectGroup != _curr.pSelectGroup)
-            {
-                if (m_veCurrentSelectGroup.size() == 1)
-                {
-                   connect(pGroup, &Group::SetUpDataImageShowSig,
-                       this, &MainAndSecondaryCamerasWnd::GetUpDataImageShowSignals4);
-                }
-                else
-                {
-                   connect(pGroup, &Group::SetUpDataImageShowSig,
-                       this, &MainAndSecondaryCamerasWnd::GetUpDataImageShowSignals0);
-                }
-                m_veCurrentSelectGroup.push_back(_curr);
-                
-            }
-            else
-            {
-                if (m_veCurrentSelectGroup.size() == 0)
-                {
-                    connect(pGroup, &Group::SetUpDataImageShowSig,
-                        this, &MainAndSecondaryCamerasWnd::GetUpDataImageShowSignals0);
-                }
-                m_veCurrentSelectGroup.clear();
-                m_veCurrentSelectGroup.push_back(_curr);
-                
-            }
-            UpdataLightJoystickSwitchPage();
-        }
-        else
-        {
-            if (m_veCurrentSelectGroup.size() == 1)
-            {
-                connect(pGroup, &Group::SetUpDataImageShowSig,
-                    this, &MainAndSecondaryCamerasWnd::GetUpDataImageShowSignals4);
-            }
-            else
-            {
-                connect(pGroup, &Group::SetUpDataImageShowSig,
-                    this, &MainAndSecondaryCamerasWnd::GetUpDataImageShowSignals0);
-            }
-            m_veCurrentSelectGroup.push_back(_curr);
-            UpdataLightJoystickSwitchPage();
-
-        }
-        
-    }
-}
-#endif
 
 void MainAndSecondaryCamerasWnd::wheelEvent(QWheelEvent *event)
 {
@@ -831,7 +613,6 @@ void MainAndSecondaryCamerasWnd::showEvent(QShowEvent *event) {
     isUpdatingSettings = false;
     QMainWindow::showEvent(event);
 
-    //loadSettings();
     isUpdatingSettings = false;
 }
 

+ 10 - 14
View/die-bonder-ui/OriginalWnd/MainAndSecondaryCamerasWnd.h

@@ -11,14 +11,14 @@
 #include "JOriginalMainWnd.h"
 
 namespace Ui {
-class MainAndSecondaryCamerasWnd;
+    class MainAndSecondaryCamerasWnd;
 }
 
 class MainAndSecondaryCamerasWnd : public JOriginalMainWnd
 {
     Q_OBJECT
 public:
-    explicit MainAndSecondaryCamerasWnd(QWidget *parent = nullptr);
+    explicit MainAndSecondaryCamerasWnd(QWidget* parent = nullptr);
 
     ~MainAndSecondaryCamerasWnd();
     void initFrom();
@@ -37,26 +37,22 @@ public:
     void initLeftAndRightWidget();
 
     //封装绑定函数
-    void BindImageOrMaterial(int location,int index );
+    void BindImageOrMaterial(int location, int index);
 
     //保存信息
     void saveInfoOfLast();
-;
+    ;
 
 protected:
     void wheelEvent(QWheelEvent* event) override;
 
 
-    void checkSettings(int groupId,int index);
+    void checkSettings(int groupId, int index);
 
-    // void loadGroupSettings(int Id, int Index);
-    /**更新刷新
-     */
-    void loadGroupSettings(int Id, int Index);
 
-    void showEvent(QShowEvent *event) override;
+    void showEvent(QShowEvent* event) override;
 
-    void hideEvent(QHideEvent *event) override;
+    void hideEvent(QHideEvent* event) override;
 
     void timerEvent(QTimerEvent* event) override;
 
@@ -75,7 +71,7 @@ private:
     void UpdateCameraDisplay3(int iCameraId, JVision::ImageInfo imageData) override;
     void UpdateCameraDisplay4(int iCameraId, JVision::ImageInfo imageData) override;
 
-    
+
 signals:
     void UpDataImageShowSignals0(const QPixmap& imageData);
     void UpDataImageShowSignals1(const QPixmap& imageData);
@@ -93,10 +89,10 @@ private:
 
     /**更新灯光显示
      */
-    void UpdataLightJoystickSwitchPage(int groupId, int index,bool isShow);
+    void UpdataLightJoystickSwitchPage(int groupId, int index, bool isShow);
 
 private:
-    Ui::MainAndSecondaryCamerasWnd *ui;
+    Ui::MainAndSecondaryCamerasWnd* ui;
 
     QPixmap             Left_currentPixmap;
 

+ 214 - 140
View/die-bonder-ui/OriginalWnd/SingleCameraOperationWnd.cpp

@@ -7,7 +7,7 @@
 #include <QTimer>
 #include "CameraMaterialGroupWnd/CameraImage/CameraImageHandler.h"
 
-SingleCameraOperationWnd::SingleCameraOperationWnd(QWidget *parent)
+SingleCameraOperationWnd::SingleCameraOperationWnd(QWidget* parent)
     : JOriginalMainWnd(parent)
     , ui(new Ui::SingleCameraOperationWnd), scaleFactor(1.0)
 {
@@ -15,7 +15,6 @@ SingleCameraOperationWnd::SingleCameraOperationWnd(QWidget *parent)
     ui->viewwidgetgroup->resizeSingleUI(true);
     ui->lightJoystickSwitchPage->resizeSingleUI();
     isShow = true;
-    liveClick = true;
 
     initFrom();
 }
@@ -29,63 +28,74 @@ SingleCameraOperationWnd::~SingleCameraOperationWnd()
 void SingleCameraOperationWnd::initFrom() {
 
     // 设置右上部分
-    QWidget *viewport = ui->scrollArea->viewport();
-    QWidget *container = new QWidget(viewport);
-    QVBoxLayout *layout = new QVBoxLayout(container);
+    QWidget* viewport = ui->scrollArea->viewport();
+    QWidget* container = new QWidget(viewport);
+    QVBoxLayout* layout = new QVBoxLayout(container);
 
     layout->setSpacing(16); // 设置Group之间的间隔距离
     layout->setMargin(0);
-
-    QList<int> numbers = {1, 2, 3, 4, 5, 6, 7, 8};
-
-    QList<Group*> widgets;
-
-    for (int i = 0; i < numbers.size(); ++i) {
-        int num = numbers[i];
-        CameraImageHandler* manager = new CameraImageHandler(num);
-        Group* widget = manager->getGroup();
-        //connect(widget,&Group::send_button_Signal,this,&SingleCameraOperationWnd::showAndHideButton);
-		//connect(widget,&Group::send_ComboBox_singal,this,&SingleCameraOperationWnd::handleComBoxChange);
-        if (widget != nullptr) 
+    int nSize = 0;
+    if (m_pMainCameraBind != nullptr)
+    {
+        //QList<int> numbers = { 1, 2, 3, 4, 5, 6, 7, 8 };
+        nSize = m_pMainCameraBind->m_vecCamera.size();
+        if (nSize == 0) // 针对获取不到的情况
         {
-            CameraConnectUpdateImageFun(i, widget);
-            layout->addWidget(widget);
-            widgets.append(widget);
-			groupMap[num] = widget;
-        }
-        if(manager->getWafer()) {
-            waferMap.insert(num, manager->getWafer());
-        }
-        if(manager->getWafer()) {
-            waffleMap.insert(num, manager->getWaffle());
+            nSize = 5;
+            //JMessageTip::Message_warning("a");
         }
-        if(manager->getMaterialBox()){
-            materialBoxMap.insert(num,manager->getMaterialBox());
-        }
-        if (manager->getBond()) {
-            bondMap.insert(num, manager->getBond());
+        QList<int> numbers;
+
+        for (int i = 1; i <= nSize; i++)
+        {
+            numbers.push_back(i);
         }
 
-        delete manager;
-    }
 
-    // 设置控件的最小高度和最大宽度
-    int minHeight = 162;
-    int maxWidth = 244;
-    for (Group* w : widgets) {
-        w->setMinimumHeight(minHeight);
-        w->setMaximumWidth(maxWidth);
-    }
+        for (int i = 0; i < numbers.size(); ++i) {
+            int num = numbers[i];
+            CameraImageHandler* manager = new CameraImageHandler(num);
+            Group* widget = manager->getGroup();
+            if (widget != nullptr)
+            {
+                CameraConnectUpdateImageFun(i, widget);
+                layout->addWidget(widget);
+                m_allGroup.append(widget);
+                groupMap[num] = widget;
+            }
+            if (manager->getWafer()) {
+                waferMap.insert(num, manager->getWafer());
+            }
+            if (manager->getWaffle()) {
+                waffleMap.insert(num, manager->getWaffle());
+            }
+            if (manager->getMaterialBox()) {
+                materialBoxMap.insert(num, manager->getMaterialBox());
+            }
+            if (manager->getBond()) {
+                bondMap.insert(num, manager->getBond());
+            }
+
+            delete manager;
+        }
 
-    container->setLayout(layout);
-    ui->scrollArea->setWidget(container);
-    ui->scrollArea->resize(261, 700);
-    //checkSettings(int groupId,int index);
+        // 设置控件的最小高度和最大宽度
+        int minHeight = 162;
+        int maxWidth = 244;
+        for (Group* w : m_allGroup) {
+            w->setMinimumHeight(minHeight);
+            w->setMaximumWidth(maxWidth);
+        }
 
+        container->setLayout(layout);
+        ui->scrollArea->setWidget(container);
+        ui->scrollArea->resize(261, 700);
+        initWidget();
 
+    }
 }
 
-void SingleCameraOperationWnd::closeEvent(QCloseEvent *event) {
+void SingleCameraOperationWnd::closeEvent(QCloseEvent* event) {
     // 保存滑块状态
     // saveSliderStates();
 
@@ -96,74 +106,42 @@ void SingleCameraOperationWnd::closeEvent(QCloseEvent *event) {
 
 
 
-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();
+void SingleCameraOperationWnd::checkSettings(int groupId, int index) {
 
     if (groupId != lastGroupId || index != lastIndex) {
+        GetCurrentSelectSlots(groupId, index);
         lastGroupId = groupId;
         lastIndex = index;
-        loadSettings();
-    }
-}
+        saveInfoOfLast();
 
-void SingleCameraOperationWnd::loadSettings()
-{
-    QSettings settings("YourCompany", "YourApplication_");
-    int groupId = settings.value("GroupId", 0).toInt();
-    int index = settings.value("Index", 0).toInt();
-    loadGroupSettings(groupId, index);
+    }
 }
 
-void SingleCameraOperationWnd::loadGroupSettings(int Id, int Index) {
-    QSettings settings("YourOrganization", "YourApplication");
-    settings.beginGroup(QString::number(Id));
-    QString imagePath = settings.value("ImagePath1").toString();
-    int materialWndType = settings.value("MaterialWndType").toInt();
-    QStringList textList = settings.value("TextList").toStringList();
-    settings.endGroup();
-
-
-    QPixmap newPixmap;
-    // 判断是实时图片还是物料窗口
-    if (Index == 1) {
-
-        newPixmap = QPixmap(imagePath);
-        QStringList test = { "1","2" };
-        ui->viewwidgetgroup->updateOperateWidget(newPixmap);
-        ui->viewwidgetgroup->setEnableControls(true);
-
-    }else if (Index == 2) {
- 
-        updateMaterialWidget(materialWndType, Id);
-        ui->viewwidgetgroup->setEnableControls(false);
-        
-    }
-        
-    
 
-}
 
-void SingleCameraOperationWnd::updateMaterialWidget( int materialWndType, int groupId)
+void SingleCameraOperationWnd::updateMaterialWidget(int materialWndType, int groupId)
 {
-    switch (materialWndType) 
+    switch (materialWndType)
     {
-        case 1: ui->viewwidgetgroup->setWafer(waferMap.value(lastGroupId)); break;
-        case 2: ui->viewwidgetgroup->setWaffle(waffleMap.value(lastGroupId)); break;
-        case 3: ui->viewwidgetgroup->setMaterialBox(materialBoxMap.value(lastGroupId)); break;
-        case 4: ui->viewwidgetgroup->setBond(bondMap.value(groupId)); break;
+    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;
     }
 }
 
 void SingleCameraOperationWnd::InitMainCameraBind(CameraBind* pCameraBind)
 {
-
+    m_pMainCameraBind = pCameraBind;
+    initFrom();
 }
 
 void SingleCameraOperationWnd::UnCameraBind()
 {
-
+    for (size_t i = 0; i < m_allGroup.size(); i++)
+    {
+        CameraConnectUpdateImageFun(i, m_allGroup[i], true);
+    }
 }
 
 void SingleCameraOperationWnd::CameraConnectUpdateImageFun(int nIndex, Group* widget, bool isUnCameraBind /*= false*/)
@@ -172,7 +150,7 @@ void SingleCameraOperationWnd::CameraConnectUpdateImageFun(int nIndex, Group* wi
     {
         if (isUnCameraBind)
         {
-            //disconnect(widget, &Group::SetCurrentSelectSig, this, &ChartsAndCamerasWnd::GetCurrentSelectSlots);
+            disconnect(widget, &Group::SetCurrentSelectSig, this, &SingleCameraOperationWnd::checkSettings);
             disconnect(this, pCamerasImage, widget, &Group::UpDataImageShowSlots);
         }
         else
@@ -236,7 +214,7 @@ void SingleCameraOperationWnd::UpdateCameraDisplay4(int iCameraId, JVision::Imag
     emit UpDataImageShowSignals4(QPixmap::fromImage(image));
 }
 
-void SingleCameraOperationWnd::wheelEvent(QWheelEvent *event)
+void SingleCameraOperationWnd::wheelEvent(QWheelEvent* event)
 {
     //mousePos = ui->viewwidgetgroup->getOperatewidget()->mapFromGlobal(event->globalPos());
 
@@ -262,19 +240,6 @@ void SingleCameraOperationWnd::wheelEvent(QWheelEvent *event)
 
 }
 
-//void SingleCameraOperationWnd::onComboBoxIndexChanged(int index) {
-//    // 根据index获取图片路径
-//    QString imagePath = getImagePathFromIndex(index);
-//    if (!imagePath.isEmpty()) {
-//        QPixmap newPixmap(imagePath);
-//        QPixmap scaledPixmap = newPixmap.scaled(ui->viewwidgetgroup->getOperatewidget()->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
-//        ui->viewwidgetgroup->getOperatewidget()->setPixmap(scaledPixmap);
-//        // 更新当前图片的成员变量
-//        currentPixmap = scaledPixmap;
-//        scaleFactor = 1.0;
-//        ui->viewwidgetgroup->label_Percentage->setText("100%");
-//    }
-//}
 
 QString SingleCameraOperationWnd::getImagePathFromIndex(int index) {
     QStringList imagePaths = {
@@ -287,29 +252,19 @@ QString SingleCameraOperationWnd::getImagePathFromIndex(int index) {
     return ":/images/test_image/image.png";
 }
 
-void SingleCameraOperationWnd::showEvent(QShowEvent *event) {
+void SingleCameraOperationWnd::showEvent(QShowEvent* event) {
     QMainWindow::showEvent(event);
-    loadSettings();
 }
 
-void SingleCameraOperationWnd::hideEvent(QHideEvent *event) {
+void SingleCameraOperationWnd::hideEvent(QHideEvent* event) {
     QMainWindow::hideEvent(event);
 }
 
 
 
 
-void SingleCameraOperationWnd::startCamera(int cameraId) {
-    m_grabber = new ImageGrabber(cameraId);
-    connect(m_grabber, &ImageGrabber::imageGrabbed,
-            this, &SingleCameraOperationWnd::updateImage);
-    m_grabber->start();
-}
-
-void SingleCameraOperationWnd::stopCamera(int cameraId){
-    m_grabber->stop();
-}
-void SingleCameraOperationWnd::on_DatacomboBox_currentIndexChanged(int index){
+#if 0
+void SingleCameraOperationWnd::on_DatacomboBox_currentIndexChanged(int index) {
     QSettings settings("YourCompany", "YourApplication_");
     int groupId = settings.value("GroupId", 0).toInt();
     if (groupMap.contains(groupId)) {
@@ -317,20 +272,15 @@ void SingleCameraOperationWnd::on_DatacomboBox_currentIndexChanged(int index){
         // 修改属性
 
         group->setDatacomboBox(index);
-    } else {
+    }
+    else {
         qDebug() << "Group with id" << groupId << "not found.";
     }
 
 }
-//void SingleCameraOperationWnd::handleComBoxChange(int groupId,int index){
-//    QSettings settings("YourCompany", "YourApplication_");
-//    int currentGroupId = settings.value("GroupId", 0).toInt();
-//    if(currentGroupId == groupId){
-//        ui->viewwidgetgroup->DataSources->setCurrentIndex(index);
-//    }
-//}
-
-void SingleCameraOperationWnd::updateImage(const QImage&image){
+#endif
+
+void SingleCameraOperationWnd::updateImage(const QImage& image) {
     QPixmap pixmap = QPixmap::fromImage(image);
     QSize size = ui->viewwidgetgroup->getOperatewidget()->size();
     // QPixmap scaledPixmap = pixmap.scaled(size, Qt::KeepAspectRatio, Qt::SmoothTransformation);
@@ -339,12 +289,136 @@ void SingleCameraOperationWnd::updateImage(const QImage&image){
 
 }
 
-void SingleCameraOperationWnd::loadLiveVedio(){
-    if(liveClick == true){
-        startCamera(0);
-        liveClick = false;
-    }else{
-        stopCamera(0);
-        liveClick = true;
+
+
+void SingleCameraOperationWnd::GetGroupImageShowSignals(const QPixmap& imageData) {
+    QSize size = ui->viewwidgetgroup->getOperatewidget()->size();
+    QPixmap scaledPixmap = imageData.scaled(size, Qt::KeepAspectRatio, Qt::SmoothTransformation);
+    ui->viewwidgetgroup->setScaleFactorSize(scaledPixmap);
+    // m_lastRightPixmap = imageData;
+}
+
+void SingleCameraOperationWnd::BindImageOrMaterial(int index) {
+
+    if (index == m_nImageIndex) {
+
+        m_veCurrentSelectGroup.isBond = true;
+        connect(m_veCurrentSelectGroup.pSelectGroup, &Group::SetUpDataImageShowSig,
+            this, &SingleCameraOperationWnd::GetGroupImageShowSignals);
+        UpdataLightJoystickSwitchPage(m_veCurrentSelectGroup.pSelectGroup->m_nGroupId, true);
+
     }
+    else {
+        QSettings settings("YourOrganization", "YourApplication");
+        settings.beginGroup(QString::number(m_veCurrentSelectGroup.pSelectGroup->m_nGroupId));
+        int materialWndType = settings.value("MaterialWndType").toInt();
+        settings.endGroup();
+        m_veCurrentSelectGroup.isBond = false;
+        UpdataLightJoystickSwitchPage(m_veCurrentSelectGroup.pSelectGroup->m_nGroupId, false);
+        updateMaterialWidget(materialWndType, m_veCurrentSelectGroup.pSelectGroup->m_nGroupId);
+
+    }
+
 }
+
+void SingleCameraOperationWnd::initWidget() {
+    //初始化当前页面的信息
+
+    QSettings settings("YourOrganization", "YourApplication");
+    lastIndex = settings.value("SingleLastIndex", 1).toInt();
+    lastGroupId = settings.value("SingleLastGroupId", 1).toInt();
+
+    //处理各种情况的初始化
+    if (m_pMainCameraBind == nullptr || m_allGroup.size() == 0)
+    {
+        return;
+    }
+
+    //当lastGroupId大于m_allGroup.size()时,初始化lastGroupId为1
+    if (m_allGroup.size() < lastGroupId) {
+
+        lastGroupId = 1;
+        lastIndex = 1;
+        m_veCurrentSelectGroup.isInitialed = true;
+        m_veCurrentSelectGroup.pSelectGroup = m_allGroup.at(lastGroupId - 1);
+
+        BindImageOrMaterial(m_nImageIndex);
+
+    }
+    else {
+    }
+    m_veCurrentSelectGroup.isInitialed = true;
+    m_veCurrentSelectGroup.pSelectGroup = m_allGroup.at(lastGroupId - 1);
+    if (lastIndex == 1) {
+
+        BindImageOrMaterial(m_nImageIndex);
+
+    }
+    else {
+
+        BindImageOrMaterial(m_nMaterialIndex);
+
+    }
+
+}
+
+void SingleCameraOperationWnd::saveInfoOfLast() {
+    QSettings settings("YourOrganization", "YourApplication");
+    settings.setValue("SingleLastIndex", lastIndex);
+    settings.setValue("SingleLastGroupId", lastGroupId);
+}
+
+void SingleCameraOperationWnd::GetCurrentSelectSlots(int groupId, int nIndex) {
+    int nOnClickGroupId = groupId - 1;
+    if (m_pMainCameraBind == nullptr || m_allGroup.size() < groupId)
+    {
+        return;
+    }
+
+    //判断更新前的窗口是否是绑定相机
+    if (m_veCurrentSelectGroup.isBond == true) {
+        //解绑
+        disconnect(m_veCurrentSelectGroup.pSelectGroup, &Group::SetUpDataImageShowSig,
+            this, &SingleCameraOperationWnd::GetGroupImageShowSignals);
+    }
+    //判断index是相机还是物料
+    if (nIndex == 2) {
+
+        m_veCurrentSelectGroup.pSelectGroup = m_allGroup.at(nOnClickGroupId);
+        BindImageOrMaterial(m_nMaterialIndex);
+
+    }
+    else if (nIndex == 1) {
+        m_veCurrentSelectGroup.pSelectGroup = m_allGroup.at(nOnClickGroupId);
+        BindImageOrMaterial(m_nImageIndex);
+    }
+}
+
+void SingleCameraOperationWnd::UpdataLightJoystickSwitchPage(int groupId, bool isShow)
+{
+    auto Fun = [&](Group* pGroup, LightJoystickSwitchPage* p, ControlOperationPage* pContPage, bool bShow)
+    {
+        p->UpdatemPageGroup(pGroup);
+        p->InitMainCameraBind(m_pMainCameraBind, bShow);
+        p->HideOrShowPage(bShow);
+        if (bShow)
+        {
+            pContPage->UpDateCameraBind(m_pMainCameraBind);
+        }
+        else
+        {
+            pContPage->setSwitchJoystickButEnable(bShow);
+        }
+
+    };
+
+
+        disconnect(ui->viewwidgetgroup, &ControlOperationPage::SendModuleTypeSignals,
+            ui->lightJoystickSwitchPage, &LightJoystickSwitchPage::GetModuleTypeSlots);
+        Group* currGroup = m_allGroup.at(groupId - 1);
+        Fun(currGroup, ui->lightJoystickSwitchPage, ui->viewwidgetgroup, isShow);
+        connect(ui->viewwidgetgroup, &ControlOperationPage::SendModuleTypeSignals,
+            ui->lightJoystickSwitchPage, &LightJoystickSwitchPage::GetModuleTypeSlots);
+
+
+}

+ 33 - 28
View/die-bonder-ui/OriginalWnd/SingleCameraOperationWnd.h

@@ -13,7 +13,7 @@
 #include "CameraMaterialGroupWnd/MaterialWindow/DraggableLine.h"
 #include "JOriginalMainWnd.h"
 namespace Ui {
-class SingleCameraOperationWnd;
+    class SingleCameraOperationWnd;
 }
 
 class SingleCameraOperationWnd : public JOriginalMainWnd
@@ -21,35 +21,38 @@ class SingleCameraOperationWnd : public JOriginalMainWnd
     Q_OBJECT
 
 public:
-    explicit SingleCameraOperationWnd(QWidget *parent = nullptr);
+    explicit SingleCameraOperationWnd(QWidget* parent = nullptr);
     ~SingleCameraOperationWnd();
 
     void initFrom();
-    void closeEvent(QCloseEvent *event) override;
+    void closeEvent(QCloseEvent* event) override;
 
-    void loadGroupSettings(int Id, int Index);
 
-	void startCamera(int cameraId);
-    void stopCamera(int cameraId);
-    void updateImage(const QImage&image);
+    void updateImage(const QImage& image);
     void updateMaterialWidget(int materialWndType, int groupId);
+
+    //封装绑定函数
+    void BindImageOrMaterial(int index);
+    //保存信息
+    void saveInfoOfLast();
+
+    void initWidget();
+    void UpdataLightJoystickSwitchPage(int groupId, bool isShow);
 public slots: // 确保这里声明了槽函数
-    // void onComboBoxIndexChanged(int index); // 确保签名匹配
+
     QString getImagePathFromIndex(int index);
 
-    void on_DatacomboBox_currentIndexChanged(int index);
-    //void handleComBoxChange(int groupId,int index);
-    void loadLiveVedio();
+    //void on_DatacomboBox_currentIndexChanged(int index);
+    void GetGroupImageShowSignals(const QPixmap& imageData);
 protected:
-    void wheelEvent(QWheelEvent *event) override;
-    void loadSettings();
-    void checkSettings(int groupId,int index);
-    void showEvent(QShowEvent *event) override;
-    void hideEvent(QHideEvent *event) override;
+    void wheelEvent(QWheelEvent* event) override;
+    void checkSettings(int groupId, int index);
+    void showEvent(QShowEvent* event) override;
+    void hideEvent(QHideEvent* event) override;
 
 private slots:
 
-
+    void GetCurrentSelectSlots(int groupId, int nIndex);
     QPixmap getCurrentPixmap() const {
         return currentPixmap;
     }
@@ -75,20 +78,20 @@ signals:
     void UpDataImageShowSignals3(const QPixmap& imageData);
     void UpDataImageShowSignals4(const QPixmap& imageData);
 
-private : 
-    Ui::SingleCameraOperationWnd *ui;
+private:
+    Ui::SingleCameraOperationWnd* ui;
 
     QPixmap currentPixmap;
     qreal scaleFactor;
     int lastGroupId = -1;
     int lastIndex = -1;
 
-    Wafer *wafer; // 声明Wafer指针
-    Waffle *waffle; // 声明Waffle指针
-    MaterialBox *materialbox; // 声明materialbox指针
+    Wafer* wafer; // 声明Wafer指针
+    Waffle* waffle; // 声明Waffle指针
+    MaterialBox* materialbox; // 声明materialbox指针
     Bond* bond;
     bool isShow;
-    ImageGrabber *m_grabber;
+    ImageGrabber* m_grabber;
     QMap<int, Group*> groupMap;
     int currentCameraId;
     QMap<int, Wafer*> waferMap;
@@ -96,13 +99,15 @@ private :
     QMap<int, MaterialBox*> materialBoxMap;
     QMap<int, Bond*> bondMap;
     OperateMode currentMode = ModeImage;
-    QGraphicsView *currentView = nullptr;
+    QGraphicsView* currentView = nullptr;
     QPoint mousePos;
     double previousScaleFactor;
-
-    void updateScale(double newScaleFactor); // 更新缩放比例
-    void applyScale(); // 应用缩放
-    bool liveClick;
+    /**保存所有的后续使用
+*/
+    QStack<Group*>                  m_allGroup;
+    ST_CURRENT_SELECT_GROUP         m_veCurrentSelectGroup;
+    const int                       m_nImageIndex = 1;
+    const int                       m_nMaterialIndex = 2;
 };
 
 #endif // SINGLECAMERAOPERATIONWND_H