Browse Source

修改提交

yun 2 days ago
parent
commit
30750db2c0

BIN
Output/bin/x64/SBTdie-bonder-ui.exe


BIN
Output/bin/x64/SBTdie-bonder-ui.ilk


+ 20 - 289
View/die-bonder-ui/OriginalWnd/ChartsAndCamerasWnd.cpp

@@ -213,21 +213,7 @@ void ChartsAndCamerasWnd::initFrom() {
     connect(timer, &QTimer::timeout, this, &ChartsAndCamerasWnd::checkSettings);
     timer->start(100);
 
-    ui->label_Percentage->setAlignment(Qt::AlignCenter);
-
-    initSliders();
-    initLineEdits();
-    initProgressBar();
-    // 连接 QSlider 的 valueChanged 信号到 QProgressBar 的 setValue 槽
-    connect(ui->RedLightverticalSlider, &QSlider::valueChanged, ui->RedLightprogressBar, &QProgressBar::setValue);
-    connect(ui->BlueLightverticalSlider, &QSlider::valueChanged, ui->BlueLightprogressBar, &QProgressBar::setValue);
-    connect(ui->GreenLightverticalSlider, &QSlider::valueChanged, ui->GreenLightprogressBar, &QProgressBar::setValue);
-    connect(ui->DotLightverticalSlider, &QSlider::valueChanged, ui->DotLightprogressBar, &QProgressBar::setValue);
-    connectSliderAndLineEdit(ui->RedLightverticalSlider, ui->RedLightlineEdit);
-    connectSliderAndLineEdit(ui->GreenLightverticalSlider, ui->GreenLightlineEdit);
-    connectSliderAndLineEdit(ui->BlueLightverticalSlider, ui->BlueLightlineEdit);
-    connectSliderAndLineEdit(ui->DotLightverticalSlider, ui->DotLightlineEdit);
-    connect(ui->Operatewidget,&ImageWidget::sendDoubleClicksignal,this,&ChartsAndCamerasWnd::handleDoubleClick);
+   
     QWidget *viewport = ui->scrollArea->viewport();
     QWidget *container = new QWidget(viewport);
     QHBoxLayout *layout = new QHBoxLayout(container);
@@ -281,67 +267,8 @@ void ChartsAndCamerasWnd::initFrom() {
     ui->scrollArea->setWidget(container);
     ui->scrollArea->resize(508, 177);
 
-    ui->Operatewidget->setMouseTracking(true);
 }
 
-void ChartsAndCamerasWnd::initSliders() {
-    QList<QSlider*> sliders = {
-        ui->RedLightverticalSlider, ui->GreenLightverticalSlider,
-        ui->BlueLightverticalSlider, ui->DotLightverticalSlider
-    };
-    QList<int> initialValues = {22, 11, 0, 0};
-
-    for (int i = 0; i < sliders.size(); ++i) {
-        sliders[i]->setMinimum(0);
-        sliders[i]->setMaximum(100);
-        sliders[i]->setValue(initialValues[i]);
-    }
-}
-
-void ChartsAndCamerasWnd::initLineEdits() {
-    QList<QLineEdit*> lineEdits = {
-        ui->RedLightlineEdit, ui->GreenLightlineEdit,
-        ui->BlueLightlineEdit, ui->DotLightlineEdit
-    };
-
-    for (QLineEdit* lineEdit : lineEdits) {
-        lineEdit->setAlignment(Qt::AlignCenter);
-    }
-}
-
-void ChartsAndCamerasWnd::initProgressBar(){
-    QList<int> initialValues = {22, 11, 0, 0};
-    QList<QProgressBar*> progressBar = {
-        ui->RedLightprogressBar,ui->GreenLightprogressBar,
-        ui->BlueLightprogressBar,ui->DotLightprogressBar
-    };
-    for (int i = 0; i < progressBar.size(); ++i) {
-        progressBar[i]->setMinimum(0);
-        progressBar[i]->setMaximum(100);
-        progressBar[i]->setValue(initialValues[i]);
-    }
-}
-
-void ChartsAndCamerasWnd::connectSliderAndLineEdit(QSlider* slider, QLineEdit* lineEdit)
-{
-    QIntValidator* validator = new QIntValidator(slider->minimum(), slider->maximum(), lineEdit);
-    lineEdit->setValidator(validator);
-
-    connect(slider, &QSlider::valueChanged, [lineEdit](int value) {
-        lineEdit->setText(QString::number(value));
-    });
-
-    connect(lineEdit, &QLineEdit::textChanged, [slider](const QString &text) {
-        bool ok;
-        int value = text.toInt(&ok);
-        if (ok && value >= slider->minimum() && value <= slider->maximum()) {
-            slider->setValue(value);
-        } else if (!text.isEmpty()) {
-            int closestValue = qMin(qMax(text.toInt(&ok), slider->minimum()), slider->maximum());
-            slider->setValue(closestValue);
-        }
-    });
-}
 
 void ChartsAndCamerasWnd::checkSettings() {
     QSettings settings("YourCompany", "YourApplication_");
@@ -371,124 +298,34 @@ void ChartsAndCamerasWnd::loadGroupSettings(int Id, int Index) {
     QStringList textList = settings.value("TextList").toStringList();
     settings.endGroup();
 
-    QSize size = ui->Operatewidget->size();
-
     QPixmap newPixmap;
     // 判断是实时图片还是物料窗口
     if (Index == 1) {
-        clearLayout();
-        newPixmap = QPixmap(imagePath1);
-        QPixmap scaledPixmap = newPixmap.scaled(size, Qt::KeepAspectRatio, Qt::SmoothTransformation);
-        currentMode = ModeImage;
-        currentPixmap = scaledPixmap;
-        scaleFactor = 1.0;
-        previousScaleFactor = 1.0;
-        ui->Operatewidget->setPixmap(scaledPixmap);
-        double percentage = scaleFactor * 100;
-        QString percentageStr = QString::number((int)percentage);
-        ui->label_Percentage->setText(QString("%1%").arg(percentageStr));
-    } else if (Index == 2) {
-        if (materialWndType == 1) {
-            clearLayout();
-            // WaferWidget(Id);
-            ui->Operatewidget->clearPixmap();
-            QVBoxLayout *layout = new QVBoxLayout(ui->Operatewidget);
-            waferMap.value(Id)->initFrom(ui->Operatewidget);
-
-            layout->setContentsMargins(0, 0, 0, 0);
-            layout->addWidget(waferMap.value(Id)->view);
-            ui->Operatewidget->setLayout(layout);
-            currentMode = ModeView;
-            currentView = waferMap.value(Id)->view;
-            scaleFactor = 1.0;
-            applyScale();
-        } else if (materialWndType == 2) {
-            clearLayout();
-            ui->Operatewidget->clearPixmap();
-            QVBoxLayout *layout = new QVBoxLayout(ui->Operatewidget);
-            waffleMap.value(Id)->initFrom(ui->Operatewidget);
-
-            layout->setContentsMargins(0, 0, 0, 0);
-            layout->addWidget(waffleMap.value(Id)->view);
-            ui->Operatewidget->setLayout(layout);
-            currentMode = ModeView;
-            currentView = waffleMap.value(Id)->view;
-            scaleFactor = 1.0;
-            applyScale();
-        } else if (materialWndType == 3) {
-            clearLayout();
-            QVBoxLayout *layout = new QVBoxLayout(ui->Operatewidget);
-            materialBoxMap.value(Id)->initFrom(ui->Operatewidget);
-            layout->setContentsMargins(0, 0, 0, 0);
-            layout->addWidget(materialBoxMap.value(Id)->view);
-            ui->Operatewidget->setLayout(layout);
-            currentMode = ModeView;
-            currentView = materialBoxMap.value(Id)->view;
-            scaleFactor = 1.0;
-            applyScale();
-        }
-    }
-
-    // QPixmap scaledPixmap = newPixmap.scaled(size, Qt::KeepAspectRatio, Qt::SmoothTransformation);
-    // ui->Operatewidget->setPixmap(scaledPixmap);
 
-    // // 更新当前图片的成员变量
-    // currentPixmap = scaledPixmap;
-    // scaleFactor = 1.0;
-    // ui->label_Percentage->setText("100%");
+        newPixmap = QPixmap(imagePath);
+        QStringList test = { "1","2" };
+        ui->viewwidgetgroup->updateOperateWidget(newPixmap, test);
 
-    ui->DatacomboBox->clear();
-    ui->DatacomboBox->addItems(textList);
-    // connect(ui->DatacomboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(Demo001_3::onComboBoxIndexChanged(int)));
-}
-
-void ChartsAndCamerasWnd::clearLayout() {
-    // 获取当前布局
-    QLayout* layout = ui->Operatewidget->layout();
-    if (layout) {
-        QLayoutItem *child;
-        while ((child = layout->takeAt(0)) != nullptr) {
-            if (child->widget() != nullptr) {
-                delete child->widget();  // 删除控件
-            }
-            delete child;  // 删除布局项
-        }
-        delete layout;  // 删除布局本身
+    }else if (Index == 2) {
+ 
+        updateMaterialWidget(materialWndType, Id);
+        
     }
 }
+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;
+    }
 
-// 圆晶
-void ChartsAndCamerasWnd::WaferWidget(int Id) {
-    QVBoxLayout *layout = new QVBoxLayout(ui->Operatewidget);
-    waferMap.value(Id)->initFrom(ui->Operatewidget);
-
-    layout->setContentsMargins(0, 0, 0, 0);
-    layout->addWidget(waferMap.value(Id)->view);
-    ui->Operatewidget->setLayout(layout);
-    ui->Operatewidget->setFixedSize(480, 480);
 }
 
-// 华夫盒
-void ChartsAndCamerasWnd::WaffleWidget() {
-    QVBoxLayout *layout = new QVBoxLayout(ui->Operatewidget);
-    waffle = new Waffle(1, ui->Operatewidget);
 
-    layout->setContentsMargins(0, 0, 0, 0);
-    layout->addWidget(waffle);
-    ui->Operatewidget->setLayout(layout);
-    ui->Operatewidget->setFixedSize(480, 480);
-}
 
-// 料盒
-void ChartsAndCamerasWnd::MaterialBoxWidget() {
-    QVBoxLayout *layout = new QVBoxLayout(ui->Operatewidget);
-    materialbox = new MaterialBox(1, ui->Operatewidget);
 
-    layout->setContentsMargins(0, 0, 0, 0);
-    layout->addWidget(materialbox);
-    ui->Operatewidget->setLayout(layout);
-    ui->Operatewidget->setFixedSize(480, 480);
-}
+
 
 void ChartsAndCamerasWnd::InitMainCameraBind(CameraBind* pCameraBind)
 {
@@ -526,75 +363,17 @@ void ChartsAndCamerasWnd::UpdateCameraDisplay4(int iCameraId, JVision::ImageInfo
 //
 //}
 
-void ChartsAndCamerasWnd::handleDoubleClick(){
-    if (currentMode == ModeImage) {
-        QPixmap scaledImage = currentPixmap.scaled(currentPixmap.width(), currentPixmap.height(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
-        ui->Operatewidget->setPixmap(scaledImage); // 这里传递缩放后的图片
-    } else if (currentMode == ModeView && currentView) {
-        QTransform transform;
-        transform.scale(1, 1);
-        currentView->setTransform(transform);
-    }
-    scaleFactor = 1.0;
-    previousScaleFactor = 1.0;
-    ui->label_Percentage->setText("100%");
-}
-
-// 更新缩放比例
-void ChartsAndCamerasWnd::updateScale(double newScaleFactor) {
-    if (newScaleFactor >= 1.0) {
-        scaleFactor = newScaleFactor;
-    } else {
-        scaleFactor = 1.0; // 最小缩放比例为 1.0
-    }
-
-    applyScale(); // 应用缩放
-}
-
-// 应用缩放
-void ChartsAndCamerasWnd::applyScale() {
-    if (currentMode == ModeImage) {
-        // 图片模式:缩放图片
-        int newWidth = currentPixmap.width() * scaleFactor;
-        int newHeight = currentPixmap.height() * scaleFactor;
-
-        QPixmap scaledImage = currentPixmap.scaled(newWidth, newHeight, Qt::KeepAspectRatio, Qt::SmoothTransformation);
-        ui->Operatewidget->setPixmapAndPoint(scaledImage, previousScaleFactor, scaleFactor, mousePos);
-        previousScaleFactor = scaleFactor;
-    } else if (currentMode == ModeView && currentView) {
-        // View 模式:缩放 view
-        QTransform transform;
-        transform.scale(scaleFactor, scaleFactor);
-        currentView->setTransform(transform);
-    }
-
-    // 更新百分比显示
-    double percentage = scaleFactor * 100;
-    QString percentageStr = QString::number((int)percentage);
-    ui->label_Percentage->setText(QString("%1%").arg(percentageStr));
-}
-
-void ChartsAndCamerasWnd::on_ZoomUpButton_clicked()
-{
-    mousePos = ui->Operatewidget->geometry().center();
-    updateScale(scaleFactor * 1.1);
-}
 
-void ChartsAndCamerasWnd::on_ZoomOutButton_clicked()
-{
-    mousePos = ui->Operatewidget->geometry().center();
-    updateScale(scaleFactor * 0.9);
-}
 
 void ChartsAndCamerasWnd::wheelEvent(QWheelEvent *event)
 {
-    mousePos = ui->Operatewidget->mapFromGlobal(event->globalPos());
+    mousePos = ui->viewwidgetgroup->getOperatewidget()->mapFromGlobal(event->globalPos());
 
-    if (ui->Operatewidget->rect().contains(ui->Operatewidget->mapFromGlobal(event->globalPos()))) {
+    if (ui->viewwidgetgroup->getOperatewidget()->rect().contains(ui->viewwidgetgroup->getOperatewidget()->mapFromGlobal(event->globalPos()))) {
         if (event->angleDelta().y() > 0) {
-            updateScale(scaleFactor * 1.1); // 放大
+            ui->viewwidgetgroup->updateScale(scaleFactor * 1.1); // 放大
         } else {
-            updateScale(scaleFactor * 0.9); // 缩小
+            ui->viewwidgetgroup->updateScale(scaleFactor * 0.9); // 缩小
         }
     }
     if (ui->scrollArea->rect().contains(ui->scrollArea->mapFromGlobal(event->globalPos()))) {
@@ -621,53 +400,5 @@ void ChartsAndCamerasWnd::hideEvent(QHideEvent *event) {
     QMainWindow::hideEvent(event);
 }
 
-void ChartsAndCamerasWnd::showAndHide(){
-    if(isShow == true){
-        isShow = false;
-    }else{
-        isShow = true;
-    }
-    QList<QLineEdit*> lineEdits = {
-        ui->RedLightlineEdit, ui->GreenLightlineEdit,
-        ui->BlueLightlineEdit, ui->DotLightlineEdit,
-    };
-    QList<QSlider*> sliders = {
-        ui->RedLightverticalSlider, ui->GreenLightverticalSlider,
-        ui->BlueLightverticalSlider, ui->DotLightverticalSlider
-    };
-    QList<QProgressBar*> progressBar = {
-        ui->RedLightprogressBar,ui->GreenLightprogressBar,
-        ui->BlueLightprogressBar,ui->DotLightprogressBar
-    };
-    if(isShow == true){
-        for (QLineEdit* lineEdit : lineEdits) {
-            lineEdit->show();
-        }
-        for (int i = 0; i < sliders.size(); ++i) {
-            sliders[i]->show();
-        }
-        for (int i = 0; i < progressBar.size(); ++i) {
-            progressBar[i]->show();
-        }
-        ui->BlueLight->show();
-        ui->RedLight->show();
-        ui->DotLight->show();
-        ui->GreenLight->show();
-    }else{
-        for (QLineEdit* lineEdit : lineEdits) {
-            lineEdit->hide();
-        }
-        for (int i = 0; i < sliders.size(); ++i) {
-            sliders[i]->hide();
-        }
-        for (int i = 0; i < progressBar.size(); ++i) {
-            progressBar[i]->hide();
-        }
-        ui->BlueLight->hide();
-        ui->RedLight->hide();
-        ui->DotLight->hide();
-        ui->GreenLight->hide();
 
-    }
-}
 

+ 4 - 15
View/die-bonder-ui/OriginalWnd/ChartsAndCamerasWnd.h

@@ -24,11 +24,7 @@ public:
     ~ChartsAndCamerasWnd();
 
     void initFrom();
-    void connectSliderAndLineEdit(QSlider* slider, QLineEdit* lineEdit);
-    void initLineEdits();
-    void initSliders();
-    void initProgressBar();
-    void showAndHide();
+    void updateMaterialWidget( int materialWndType, int groupId);
 
 protected:
     void wheelEvent(QWheelEvent *event) override;
@@ -38,10 +34,7 @@ protected:
     void showEvent(QShowEvent *event) override;
     void hideEvent(QHideEvent *event) override;
 
-    void clearLayout(); // 清除大窗口上当前的布局
-    void WaferWidget(int Id); // 圆晶
-    void WaffleWidget(); // 华夫盒
-    void MaterialBoxWidget(); // 料盒
+
 
 private:
     void InitMainCameraBind(CameraBind* pCameraBind) override;
@@ -52,18 +45,16 @@ private:
     void UpdateCameraDisplay4(int iCameraId, JVision::ImageInfo imageData) override;
 
 public slots: // 确保这里声明了槽函数
-    void handleDoubleClick();
+
 private slots:
-    void on_ZoomUpButton_clicked();
+    
 
     QPixmap getCurrentPixmap() const {
         return currentPixmap;
     }
 
     // 通用槽函数
-    void on_CheckBox_clicked();
 
-    void on_ZoomOutButton_clicked();
 
     // void on_GreenDiamondcheckBox_clicked();
 
@@ -125,8 +116,6 @@ private:
     QGraphicsView *currentView = nullptr;
     QPoint mousePos;
 
-    void updateScale(double newScaleFactor); // 更新缩放比例
-    void applyScale(); // 应用缩放
 };
 
 #endif // CHARTSANDCAMERASWND_H

+ 23 - 433
View/die-bonder-ui/OriginalWnd/ChartsAndCamerasWnd.ui

@@ -329,376 +329,6 @@
       <height>988</height>
      </rect>
     </property>
-    <widget class="ImageWidget" name="Operatewidget" native="true">
-     <property name="geometry">
-      <rect>
-       <x>30</x>
-       <y>72</y>
-       <width>480</width>
-       <height>480</height>
-      </rect>
-     </property>
-    </widget>
-    <widget class="QComboBox" name="DatacomboBox">
-     <property name="geometry">
-      <rect>
-       <x>30</x>
-       <y>20</y>
-       <width>400</width>
-       <height>32</height>
-      </rect>
-     </property>
-    </widget>
-    <widget class="QPushButton" name="LiveButton">
-     <property name="geometry">
-      <rect>
-       <x>446</x>
-       <y>20</y>
-       <width>60</width>
-       <height>32</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string>Live</string>
-     </property>
-    </widget>
-    <widget class="QWidget" name="Toolbar" native="true">
-     <property name="geometry">
-      <rect>
-       <x>16</x>
-       <y>572</y>
-       <width>508</width>
-       <height>32</height>
-      </rect>
-     </property>
-     <widget class="Line" name="line">
-      <property name="geometry">
-       <rect>
-        <x>80</x>
-        <y>8</y>
-        <width>1</width>
-        <height>16</height>
-       </rect>
-      </property>
-      <property name="orientation">
-       <enum>Qt::Vertical</enum>
-      </property>
-     </widget>
-     <widget class="QPushButton" name="ZoomUpButton">
-      <property name="geometry">
-       <rect>
-        <x>0</x>
-        <y>0</y>
-        <width>78</width>
-        <height>32</height>
-       </rect>
-      </property>
-      <property name="text">
-       <string/>
-      </property>
-     </widget>
-     <widget class="Line" name="line_3">
-      <property name="geometry">
-       <rect>
-        <x>156</x>
-        <y>8</y>
-        <width>1</width>
-        <height>16</height>
-       </rect>
-      </property>
-      <property name="orientation">
-       <enum>Qt::Vertical</enum>
-      </property>
-     </widget>
-     <widget class="Line" name="line_4">
-      <property name="geometry">
-       <rect>
-        <x>255</x>
-        <y>8</y>
-        <width>1</width>
-        <height>16</height>
-       </rect>
-      </property>
-      <property name="orientation">
-       <enum>Qt::Vertical</enum>
-      </property>
-     </widget>
-     <widget class="Line" name="line_5">
-      <property name="geometry">
-       <rect>
-        <x>343</x>
-        <y>8</y>
-        <width>1</width>
-        <height>16</height>
-       </rect>
-      </property>
-      <property name="orientation">
-       <enum>Qt::Vertical</enum>
-      </property>
-     </widget>
-     <widget class="Line" name="line_6">
-      <property name="geometry">
-       <rect>
-        <x>415</x>
-        <y>8</y>
-        <width>1</width>
-        <height>16</height>
-       </rect>
-      </property>
-      <property name="orientation">
-       <enum>Qt::Vertical</enum>
-      </property>
-     </widget>
-     <widget class="QPushButton" name="pushButton_2">
-      <property name="geometry">
-       <rect>
-        <x>417</x>
-        <y>0</y>
-        <width>87</width>
-        <height>32</height>
-       </rect>
-      </property>
-      <property name="text">
-       <string>.......</string>
-      </property>
-     </widget>
-     <widget class="QPushButton" name="ZoomOutButton">
-      <property name="geometry">
-       <rect>
-        <x>82</x>
-        <y>0</y>
-        <width>72</width>
-        <height>32</height>
-       </rect>
-      </property>
-      <property name="text">
-       <string/>
-      </property>
-     </widget>
-     <widget class="QPushButton" name="RulerButton">
-      <property name="geometry">
-       <rect>
-        <x>257</x>
-        <y>0</y>
-        <width>84</width>
-        <height>32</height>
-       </rect>
-      </property>
-      <property name="text">
-       <string/>
-      </property>
-     </widget>
-     <widget class="QPushButton" name="PenButton">
-      <property name="geometry">
-       <rect>
-        <x>345</x>
-        <y>0</y>
-        <width>68</width>
-        <height>32</height>
-       </rect>
-      </property>
-      <property name="text">
-       <string/>
-      </property>
-     </widget>
-     <widget class="QLabel" name="label_Percentage">
-      <property name="geometry">
-       <rect>
-        <x>158</x>
-        <y>0</y>
-        <width>95</width>
-        <height>32</height>
-       </rect>
-      </property>
-      <property name="layoutDirection">
-       <enum>Qt::LeftToRight</enum>
-      </property>
-      <property name="text">
-       <string>100%</string>
-      </property>
-     </widget>
-    </widget>
-    <widget class="QWidget" name="BackGround" native="true">
-     <property name="geometry">
-      <rect>
-       <x>26</x>
-       <y>68</y>
-       <width>488</width>
-       <height>488</height>
-      </rect>
-     </property>
-     <property name="styleSheet">
-      <string notr="true">border: 4px solid red;</string>
-     </property>
-    </widget>
-    <widget class="QWidget" name="RedLight" native="true">
-     <property name="geometry">
-      <rect>
-       <x>19</x>
-       <y>840</y>
-       <width>61</width>
-       <height>114</height>
-      </rect>
-     </property>
-     <widget class="QSlider" name="RedLightverticalSlider">
-      <property name="geometry">
-       <rect>
-        <x>10</x>
-        <y>12</y>
-        <width>18</width>
-        <height>56</height>
-       </rect>
-      </property>
-      <property name="orientation">
-       <enum>Qt::Vertical</enum>
-      </property>
-     </widget>
-     <widget class="QLineEdit" name="RedLightlineEdit">
-      <property name="geometry">
-       <rect>
-        <x>10</x>
-        <y>78</y>
-        <width>40</width>
-        <height>24</height>
-       </rect>
-      </property>
-      <property name="text">
-       <string>22</string>
-      </property>
-     </widget>
-     <widget class="QProgressBar" name="RedLightprogressBar">
-      <property name="geometry">
-       <rect>
-        <x>32</x>
-        <y>15</y>
-        <width>18</width>
-        <height>51</height>
-       </rect>
-      </property>
-      <property name="styleSheet">
-       <string notr="true"/>
-      </property>
-      <property name="value">
-       <number>24</number>
-      </property>
-      <property name="orientation">
-       <enum>Qt::Vertical</enum>
-      </property>
-      <property name="format">
-       <string/>
-      </property>
-     </widget>
-    </widget>
-    <widget class="QWidget" name="GreenLight" native="true">
-     <property name="geometry">
-      <rect>
-       <x>96</x>
-       <y>840</y>
-       <width>61</width>
-       <height>114</height>
-      </rect>
-     </property>
-     <widget class="QSlider" name="GreenLightverticalSlider">
-      <property name="geometry">
-       <rect>
-        <x>10</x>
-        <y>12</y>
-        <width>18</width>
-        <height>56</height>
-       </rect>
-      </property>
-      <property name="orientation">
-       <enum>Qt::Vertical</enum>
-      </property>
-     </widget>
-     <widget class="QLineEdit" name="GreenLightlineEdit">
-      <property name="geometry">
-       <rect>
-        <x>10</x>
-        <y>78</y>
-        <width>40</width>
-        <height>24</height>
-       </rect>
-      </property>
-      <property name="text">
-       <string>11</string>
-      </property>
-     </widget>
-     <widget class="QProgressBar" name="GreenLightprogressBar">
-      <property name="geometry">
-       <rect>
-        <x>32</x>
-        <y>15</y>
-        <width>18</width>
-        <height>51</height>
-       </rect>
-      </property>
-      <property name="value">
-       <number>24</number>
-      </property>
-      <property name="orientation">
-       <enum>Qt::Vertical</enum>
-      </property>
-      <property name="format">
-       <string/>
-      </property>
-     </widget>
-    </widget>
-    <widget class="QWidget" name="BlueLight" native="true">
-     <property name="geometry">
-      <rect>
-       <x>173</x>
-       <y>840</y>
-       <width>61</width>
-       <height>114</height>
-      </rect>
-     </property>
-     <widget class="QSlider" name="BlueLightverticalSlider">
-      <property name="geometry">
-       <rect>
-        <x>10</x>
-        <y>12</y>
-        <width>18</width>
-        <height>56</height>
-       </rect>
-      </property>
-      <property name="orientation">
-       <enum>Qt::Vertical</enum>
-      </property>
-     </widget>
-     <widget class="QLineEdit" name="BlueLightlineEdit">
-      <property name="geometry">
-       <rect>
-        <x>10</x>
-        <y>78</y>
-        <width>40</width>
-        <height>24</height>
-       </rect>
-      </property>
-      <property name="text">
-       <string>0</string>
-      </property>
-     </widget>
-     <widget class="QProgressBar" name="BlueLightprogressBar">
-      <property name="geometry">
-       <rect>
-        <x>32</x>
-        <y>15</y>
-        <width>18</width>
-        <height>51</height>
-       </rect>
-      </property>
-      <property name="value">
-       <number>24</number>
-      </property>
-      <property name="orientation">
-       <enum>Qt::Vertical</enum>
-      </property>
-      <property name="format">
-       <string/>
-      </property>
-     </widget>
-    </widget>
     <widget class="Line" name="line_2">
      <property name="geometry">
       <rect>
@@ -741,80 +371,40 @@
       </property>
      </widget>
     </widget>
-    <widget class="QWidget" name="DotLight" native="true">
+    <widget class="ControlOperationPage" name="viewwidgetgroup" native="true">
      <property name="geometry">
       <rect>
-       <x>250</x>
-       <y>840</y>
-       <width>61</width>
-       <height>114</height>
+       <x>0</x>
+       <y>0</y>
+       <width>525</width>
+       <height>605</height>
+      </rect>
+     </property>
+    </widget>
+    <widget class="LightJoystickSwitchPage" name="control" native="true">
+     <property name="geometry">
+      <rect>
+       <x>20</x>
+       <y>860</y>
+       <width>491</width>
+       <height>151</height>
       </rect>
      </property>
-     <widget class="QSlider" name="DotLightverticalSlider">
-      <property name="geometry">
-       <rect>
-        <x>10</x>
-        <y>12</y>
-        <width>18</width>
-        <height>56</height>
-       </rect>
-      </property>
-      <property name="orientation">
-       <enum>Qt::Vertical</enum>
-      </property>
-     </widget>
-     <widget class="QLineEdit" name="DotLightlineEdit">
-      <property name="geometry">
-       <rect>
-        <x>10</x>
-        <y>78</y>
-        <width>40</width>
-        <height>24</height>
-       </rect>
-      </property>
-      <property name="text">
-       <string>0</string>
-      </property>
-     </widget>
-     <widget class="QProgressBar" name="DotLightprogressBar">
-      <property name="geometry">
-       <rect>
-        <x>32</x>
-        <y>15</y>
-        <width>18</width>
-        <height>51</height>
-       </rect>
-      </property>
-      <property name="value">
-       <number>24</number>
-      </property>
-      <property name="orientation">
-       <enum>Qt::Vertical</enum>
-      </property>
-      <property name="format">
-       <string/>
-      </property>
-     </widget>
     </widget>
-    <zorder>BackGround</zorder>
-    <zorder>Operatewidget</zorder>
-    <zorder>DatacomboBox</zorder>
-    <zorder>LiveButton</zorder>
-    <zorder>Toolbar</zorder>
-    <zorder>RedLight</zorder>
-    <zorder>GreenLight</zorder>
-    <zorder>BlueLight</zorder>
-    <zorder>line_2</zorder>
-    <zorder>scrollArea</zorder>
-    <zorder>DotLight</zorder>
    </widget>
   </widget>
  </widget>
  <customwidgets>
   <customwidget>
-   <class>ImageWidget</class>
+   <class>ControlOperationPage</class>
+   <extends>QWidget</extends>
+   <header>src/RewriteControl/ControlOperationPage.h</header>
+   <container>1</container>
+  </customwidget>
+  <customwidget>
+   <class>LightJoystickSwitchPage</class>
    <extends>QWidget</extends>
-   <header location="global">ImageWidget.h</header>
+   <header>src/RewriteControl/lightjoystickswitchpage.h</header>
    <container>1</container>
   </customwidget>
  </customwidgets>

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

@@ -267,10 +267,10 @@ void MainAndSecondaryCamerasWnd::loadSettings()
     int index = settings.value("Index", 0).toInt();
 
     //TODO: 这个地方目前暂停使用
-    UpdataGroupSettings(groupId, index);
+    loadGroupSettings(groupId, index);
 }
 
-void MainAndSecondaryCamerasWnd::UpdataGroupSettings(int Id, int Index)
+void MainAndSecondaryCamerasWnd::loadGroupSettings(int Id, int Index)
 {
     //int  Id = m_currentSelectGroup.nGroupId;
     //int Index = m_currentSelectGroup.nSelectLeft1;

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

@@ -52,21 +52,12 @@ protected:
     // void loadGroupSettings(int Id, int Index);
     /**更新刷新
      */
-    void UpdataGroupSettings(int Id, int Index);
+    void loadGroupSettings(int Id, int Index);
 
     void showEvent(QShowEvent *event) override;
 
     void hideEvent(QHideEvent *event) override;
 
-
-    void clearLayout(int flag); // 清除大窗口上当前的布局
-
-    void WaferWidget(int flag); // 圆晶
-
-    void WaffleWidget(int flag); // 华夫盒
-
-    void MaterialBoxWidget(int flag); // 料盒
-
 protected:
     void timerEvent(QTimerEvent* event) override;
 

+ 47 - 364
View/die-bonder-ui/OriginalWnd/SingleCameraOperationWnd.cpp

@@ -12,7 +12,7 @@ SingleCameraOperationWnd::SingleCameraOperationWnd(QWidget *parent)
     , ui(new Ui::SingleCameraOperationWnd), scaleFactor(1.0)
 {
     ui->setupUi(this);
-    ui->Operatewidget->m_nSingleCameraOperationWnd = true;
+    ui->viewwidgetgroup->resizeSingleUI();
 
     isShow = true;
     liveClick = true;
@@ -30,26 +30,6 @@ void SingleCameraOperationWnd::initFrom() {
     connect(timer, &QTimer::timeout, this, &SingleCameraOperationWnd::checkSettings);
     timer->start(100);
 
-    ui->label_Percentage->setAlignment(Qt::AlignCenter);
-
-    // 设置右下部分
-    // loadSliderStates();
-
-    initSliders();
-    initLineEdits();
-    initProgressBar();
-    // 连接 QSlider 的 valueChanged 信号到 QProgressBar 的 setValue 槽
-    connect(ui->RedLightverticalSlider, &QSlider::valueChanged, ui->RedLightprogressBar, &QProgressBar::setValue);
-    connect(ui->BlueLightverticalSlider, &QSlider::valueChanged, ui->BlueLightprogressBar, &QProgressBar::setValue);
-    connect(ui->GreenLightverticalSlider, &QSlider::valueChanged, ui->GreenLightprogressBar, &QProgressBar::setValue);
-    connect(ui->DotLightverticalSlider, &QSlider::valueChanged, ui->DotLightprogressBar, &QProgressBar::setValue);
-    connectSliderAndLineEdit(ui->RedLightverticalSlider, ui->RedLightlineEdit);
-    connectSliderAndLineEdit(ui->GreenLightverticalSlider, ui->GreenLightlineEdit);
-    connectSliderAndLineEdit(ui->BlueLightverticalSlider, ui->BlueLightlineEdit);
-    connectSliderAndLineEdit(ui->DotLightverticalSlider, ui->DotLightlineEdit);
-	connect(ui->LiveButton,&QPushButton::clicked,this,&SingleCameraOperationWnd::loadLiveVedio);
-	connect(ui->Operatewidget,&ImageWidget::sendDoubleClicksignal,this,&SingleCameraOperationWnd::handleDoubleClick);
-
     // 设置右上部分
     QWidget *viewport = ui->scrollArea->viewport();
     QWidget *container = new QWidget(viewport);
@@ -66,8 +46,8 @@ void SingleCameraOperationWnd::initFrom() {
         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);
+        //connect(widget,&Group::send_button_Signal,this,&SingleCameraOperationWnd::showAndHideButton);
+		//connect(widget,&Group::send_ComboBox_singal,this,&SingleCameraOperationWnd::handleComBoxChange);
         if (widget != nullptr) {
             layout->addWidget(widget);
             widgets.append(widget);
@@ -98,10 +78,6 @@ void SingleCameraOperationWnd::initFrom() {
     ui->scrollArea->setWidget(container);
     ui->scrollArea->resize(261, 700);
 
-    ui->Operatewidget->setMouseTracking(true);
-    connect(ui->Operatewidget,&ImageWidget::sendDoubleClicksignal,this,&SingleCameraOperationWnd::handleDoubleClick);
-    connect(ui->DatacomboBox, QOverload<int>::of(&QComboBox::currentIndexChanged),
-            this, &SingleCameraOperationWnd::on_DatacomboBox_currentIndexChanged);
 
 }
 
@@ -113,88 +89,8 @@ void SingleCameraOperationWnd::closeEvent(QCloseEvent *event) {
     QMainWindow::closeEvent(event);
 }
 
-void SingleCameraOperationWnd::initSliders() {
-    QList<QSlider*> sliders = {
-        ui->RedLightverticalSlider, ui->GreenLightverticalSlider,
-        ui->BlueLightverticalSlider, ui->DotLightverticalSlider
-    };
-    QList<int> initialValues = {22, 11, 0, 0};
-
-    for (int i = 0; i < sliders.size(); ++i) {
-        sliders[i]->setMinimum(0);
-        sliders[i]->setMaximum(100);
-        sliders[i]->setValue(initialValues[i]);
-    }
-}
 
-void SingleCameraOperationWnd::initLineEdits() {
-    QList<QLineEdit*> lineEdits = {
-        ui->RedLightlineEdit, ui->GreenLightlineEdit,
-        ui->BlueLightlineEdit, ui->DotLightlineEdit,
-    };
 
-    for (QLineEdit* lineEdit : lineEdits) {
-        lineEdit->setAlignment(Qt::AlignCenter);
-    }
-}
-void SingleCameraOperationWnd::initProgressBar(){
-    QList<int> initialValues = {22, 11, 0, 0};
-    QList<QProgressBar*> progressBar = {
-        ui->RedLightprogressBar,ui->GreenLightprogressBar,
-        ui->BlueLightprogressBar,ui->DotLightprogressBar
-    };
-    for (int i = 0; i < progressBar.size(); ++i) {
-        progressBar[i]->setMinimum(0);
-        progressBar[i]->setMaximum(100);
-        progressBar[i]->setValue(initialValues[i]);
-    }
-}
-
-// void SingleCameraOperationWnd::saveSliderStates() {
-//     QSettings settings("YourCompany", "YourApp");
-//     settings.beginGroup("SliderStates");
-//     settings.setValue("verticalSlider", ui->verticalSlider->value());
-//     settings.setValue("verticalSlider_2", ui->verticalSlider_2->value());
-//     settings.setValue("verticalSlider_3", ui->verticalSlider_3->value());
-//     settings.setValue("verticalSlider_4", ui->verticalSlider_4->value());
-//     settings.setValue("verticalSlider_5", ui->verticalSlider_5->value());
-//     settings.setValue("verticalSlider_6", ui->verticalSlider_6->value());
-//     settings.endGroup();
-// }
-
-// void SingleCameraOperationWnd::loadSliderStates() {
-//     QSettings settings("YourCompany", "YourApp");
-//     settings.beginGroup("SliderStates");
-//     ui->verticalSlider->setValue(settings.value("verticalSlider", 11).toInt());
-//     ui->verticalSlider_2->setValue(settings.value("verticalSlider_2", 22).toInt());
-//     ui->verticalSlider_3->setValue(settings.value("verticalSlider_3", 9).toInt());
-//     ui->verticalSlider_4->setValue(settings.value("verticalSlider_4", 11).toInt());
-//     ui->verticalSlider_5->setValue(settings.value("verticalSlider_5", 0).toInt());
-//     ui->verticalSlider_6->setValue(settings.value("verticalSlider_6", 0).toInt());
-//     settings.endGroup();
-// }
-
-// QSlider 和 QLineEdit 的联动
-void SingleCameraOperationWnd::connectSliderAndLineEdit(QSlider* slider, QLineEdit* lineEdit)
-{
-    QIntValidator* validator = new QIntValidator(slider->minimum(), slider->maximum(), lineEdit);
-    lineEdit->setValidator(validator);
-
-    connect(slider, &QSlider::valueChanged, [lineEdit](int value) {
-        lineEdit->setText(QString::number(value));
-    });
-
-    connect(lineEdit, &QLineEdit::textChanged, [slider](const QString &text) {
-        bool ok;
-        int value = text.toInt(&ok);
-        if (ok && value >= slider->minimum() && value <= slider->maximum()) {
-            slider->setValue(value);
-        } else if (!text.isEmpty()) {
-            int closestValue = qMin(qMax(text.toInt(&ok), slider->minimum()), slider->maximum());
-            slider->setValue(closestValue);
-        }
-    });
-}
 
 void SingleCameraOperationWnd::checkSettings() {
     QSettings settings("YourCompany", "YourApplication_");
@@ -219,189 +115,45 @@ void SingleCameraOperationWnd::loadSettings()
 void SingleCameraOperationWnd::loadGroupSettings(int Id, int Index) {
     QSettings settings("YourOrganization", "YourApplication");
     settings.beginGroup(QString::number(Id));
-    QString imagePath1 = settings.value("ImagePath1").toString();
+    QString imagePath = settings.value("ImagePath1").toString();
     int materialWndType = settings.value("MaterialWndType").toInt();
     QStringList textList = settings.value("TextList").toStringList();
     settings.endGroup();
 
-    QSize size = ui->Operatewidget->size();
 
     QPixmap newPixmap;
     // 判断是实时图片还是物料窗口
     if (Index == 1) {
-        clearLayout();
-        newPixmap = QPixmap(imagePath1);
-        QPixmap scaledPixmap = newPixmap.scaled(size, Qt::KeepAspectRatio, Qt::SmoothTransformation);
-        currentMode = ModeImage;
-        currentPixmap = scaledPixmap;
-        scaleFactor = 1.0;
-        previousScaleFactor = 1.0;
-        ui->Operatewidget->setPixmap(scaledPixmap);
-        double percentage = scaleFactor * 100;
-        QString percentageStr = QString::number((int)percentage);
-        ui->label_Percentage->setText(QString("%1%").arg(percentageStr));
-
-    } else if (Index == 2) {
-        if (materialWndType == 1) {
-            clearLayout();
-            ui->Operatewidget->clearPixmap();
-            QVBoxLayout *layout = new QVBoxLayout(ui->Operatewidget);
-            waferMap.value(Id)->initFrom(ui->Operatewidget);
-
-            layout->setContentsMargins(0, 0, 0, 0);
-            layout->addWidget(waferMap.value(Id)->view);
-            ui->Operatewidget->setLayout(layout);
-            currentMode = ModeView;
-            currentView = waferMap.value(Id)->view;
-            scaleFactor = 1.0;
-            applyScale();
-        } else if (materialWndType == 2) {
-            clearLayout();
-            ui->Operatewidget->clearPixmap();
-            QVBoxLayout *layout = new QVBoxLayout(ui->Operatewidget);
-            waffleMap.value(Id)->initFrom(ui->Operatewidget);
-
-            layout->setContentsMargins(0, 0, 0, 0);
-            layout->addWidget(waffleMap.value(Id)->view);
-            ui->Operatewidget->setLayout(layout);
-            currentMode = ModeView;
-            currentView = waffleMap.value(Id)->view;
-            scaleFactor = 1.0;
-            applyScale();
-        } else if (materialWndType == 3) {
-            clearLayout();
-            QVBoxLayout *layout = new QVBoxLayout(ui->Operatewidget);
-            materialBoxMap.value(Id)->initFrom(ui->Operatewidget);
-            layout->setContentsMargins(0, 0, 0, 0);
-            layout->addWidget(materialBoxMap.value(Id)->view);
-            ui->Operatewidget->setLayout(layout);
-            currentMode = ModeView;
-            currentView = materialBoxMap.value(Id)->view;
-            scaleFactor = 1.0;
-            applyScale();
-
-            // MaterialBoxWidget();
-        }
-    }
 
-    //QPixmap scaledPixmap = newPixmap.scaled(size, Qt::KeepAspectRatio, Qt::SmoothTransformation);
-    //ui->Operatewidget->setPixmap(scaledPixmap);
+        newPixmap = QPixmap(imagePath);
+        QStringList test = { "1","2" };
+        ui->viewwidgetgroup->updateOperateWidget(newPixmap, test);
 
-    // 更新当前图片的成员变量
-    //currentPixmap = scaledPixmap;
-    //scaleFactor = 1.0;
-    //ui->label_Percentage->setText("100%");
-
-    ui->DatacomboBox->clear();
-    ui->DatacomboBox->addItems(textList);
-    // qDebug() << "ComboBox items added:" << ui->DatacomboBox->count();
-    // connect(ui->DatacomboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(SingleCameraOperationWnd::onComboBoxIndexChanged(int)));
-}
-
-// 清除大窗口上当前的布局
-void SingleCameraOperationWnd::clearLayout() {
-    // 获取当前布局
-    QLayout* layout = ui->Operatewidget->layout();
-    if (layout) {
-        QLayoutItem *child;
-        while ((child = layout->takeAt(0)) != nullptr) {
-            if (child->widget() != nullptr) {
-                delete child->widget();  // 删除控件
-            }
-            delete child;  // 删除布局项
-        }
-        delete layout;  // 删除布局本身
+    }else if (Index == 2) {
+ 
+        updateMaterialWidget(materialWndType, Id);
+        
     }
-}
+        
+    
 
-// 圆晶
-void SingleCameraOperationWnd::WaferWidget() {
-    // QGridLayout *layout = new QGridLayout(ui->Operatewidget);
-    // wafer = new Wafer(2, ui->Operatewidget);
-    // wafer->initFrom(ui->Operatewidget);
-
-    // layout->setContentsMargins(0, 0, 0, 0);
-    // layout->addWidget(wafer->globalWidget);
-    // ui->Operatewidget->setLayout(layout);
-    // ui->Operatewidget->setFixedSize(786, 786);
-}
-
-// 华夫盒
-void SingleCameraOperationWnd::WaffleWidget() {
-    QVBoxLayout *layout = new QVBoxLayout(ui->Operatewidget);
-    waffle = new Waffle(2, ui->Operatewidget);
-
-    layout->setContentsMargins(0, 0, 0, 0);
-    layout->addWidget(waffle);
-    ui->Operatewidget->setLayout(layout);
-    ui->Operatewidget->setFixedSize(786, 786);
 }
 
-// 料盒
-void SingleCameraOperationWnd::MaterialBoxWidget() {
-    QVBoxLayout *layout = new QVBoxLayout(ui->Operatewidget);
-    materialbox = new MaterialBox(2, ui->Operatewidget);
-
-    layout->setContentsMargins(0, 0, 0, 0);
-    layout->addWidget(materialbox);
-    ui->Operatewidget->setLayout(layout);
-    ui->Operatewidget->setFixedSize(786, 786);
+void SingleCameraOperationWnd::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;
+        }
+   
 }
 
-// 更新缩放比例
-void SingleCameraOperationWnd::updateScale(double newScaleFactor) {
-    if (newScaleFactor >= 1.0) {
-        scaleFactor = newScaleFactor;
-    } else {
-        scaleFactor = 1.0; // 最小缩放比例为 1.0
-    }
-
-    applyScale(); // 应用缩放
-}
 
-// 应用缩放
-void SingleCameraOperationWnd::applyScale() {
-    if (currentMode == ModeImage) {
-        // 图片模式:缩放图片
-        int newWidth = currentPixmap.width() * scaleFactor;
-        int newHeight = currentPixmap.height() * scaleFactor;
-
-        QPixmap scaledImage = currentPixmap.scaled(newWidth, newHeight, Qt::KeepAspectRatio, Qt::SmoothTransformation);
-        ui->Operatewidget->setPixmapAndPoint(scaledImage, previousScaleFactor, scaleFactor, mousePos);
-        previousScaleFactor = scaleFactor;
-    } else if (currentMode == ModeView && currentView) {
-        // View 模式:缩放 view
-        QTransform transform;
-        transform.scale(scaleFactor, scaleFactor);
-        currentView->setTransform(transform);
-    }
 
-    // 更新百分比显示
-    double percentage = scaleFactor * 100;
-    QString percentageStr = QString::number((int)percentage);
-    ui->label_Percentage->setText(QString("%1%").arg(percentageStr));
-}
-void SingleCameraOperationWnd::on_ZoomUpButton_clicked() {
-    mousePos = ui->Operatewidget->geometry().center();
-    updateScale(scaleFactor * 1.1);
 
-}
 
-void SingleCameraOperationWnd::on_ZoomOutButton_clicked() {
-    mousePos = ui->Operatewidget->geometry().center();
-    updateScale(scaleFactor * 0.9);
 
-}
-void SingleCameraOperationWnd::on_RulerButton_clicked(){
-    // 创建初始线段(示例长度200像素)
-    // DraggableLine* line = new DraggableLine;
-    // line->setLine(0, 0, 200, 0); // 水平线段
-    // if (currentView != nullptr) {
-    //     currentView->scene()->addItem(line);
-    //     line->setPos(20, 20);
-    //     currentView->viewport()->update();
-    // }
-}
 
 void SingleCameraOperationWnd::InitMainCameraBind(CameraBind* pCameraBind)
 {
@@ -435,13 +187,13 @@ void SingleCameraOperationWnd::UpdateCameraDisplay4(int iCameraId, JVision::Imag
 
 void SingleCameraOperationWnd::wheelEvent(QWheelEvent *event)
 {
-    mousePos = ui->Operatewidget->mapFromGlobal(event->globalPos());
+    mousePos = ui->viewwidgetgroup->getOperatewidget()->mapFromGlobal(event->globalPos());
 
-    if (ui->Operatewidget->rect().contains(ui->Operatewidget->mapFromGlobal(event->globalPos()))) {
+    if (ui->viewwidgetgroup->getOperatewidget()->rect().contains(ui->viewwidgetgroup->getOperatewidget()->mapFromGlobal(event->globalPos()))) {
         if (event->angleDelta().y() > 0) {
-            updateScale(scaleFactor * 1.1); // 放大
+            ui->viewwidgetgroup->updateScale(scaleFactor * 1.1); // 放大
         } else {
-            updateScale(scaleFactor * 0.9); // 缩小
+            ui->viewwidgetgroup->updateScale(scaleFactor * 0.9); // 缩小
         }
     }
     if (ui->scrollArea->rect().contains(ui->scrollArea->mapFromGlobal(event->globalPos()))) {
@@ -459,19 +211,19 @@ 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->Operatewidget->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
-        ui->Operatewidget->setPixmap(scaledPixmap);
-        // 更新当前图片的成员变量
-        currentPixmap = scaledPixmap;
-        scaleFactor = 1.0;
-        ui->label_Percentage->setText("100%");
-    }
-}
+//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 = {
@@ -493,77 +245,8 @@ void SingleCameraOperationWnd::hideEvent(QHideEvent *event) {
     QMainWindow::hideEvent(event);
 }
 
-void SingleCameraOperationWnd::handleDoubleClick(){
-    if (currentMode == ModeImage) {
-        QPixmap scaledImage = currentPixmap.scaled(currentPixmap.width(), currentPixmap.height(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
-        ui->Operatewidget->setPixmap(scaledImage); // 这里传递缩放后的图片
-    } else if (currentMode == ModeView && currentView) {
-        QTransform transform;
-        transform.scale(1, 1);
-        currentView->setTransform(transform);
-    }
-    scaleFactor = 1.0;
-    previousScaleFactor = 1.0;
-    ui->label_Percentage->setText("100%");
 
-}
 
-void SingleCameraOperationWnd::showAndHideButton(){
-    if(isShow == true){
-        isShow = false;
-    }else{
-        isShow = true;
-    }
-    QList<QLineEdit*> lineEdits = {
-        ui->RedLightlineEdit, ui->GreenLightlineEdit,
-        ui->BlueLightlineEdit, ui->DotLightlineEdit,
-    };
-    QList<QSlider*> sliders = {
-        ui->RedLightverticalSlider, ui->GreenLightverticalSlider,
-        ui->BlueLightverticalSlider, ui->DotLightverticalSlider
-    };
-    QList<QProgressBar*> progressBar = {
-        ui->RedLightprogressBar,ui->GreenLightprogressBar,
-        ui->BlueLightprogressBar,ui->DotLightprogressBar
-    };
-    if(isShow == true){
-        for (QLineEdit* lineEdit : lineEdits) {
-            lineEdit->show();
-        }
-        for (int i = 0; i < sliders.size(); ++i) {
-            sliders[i]->show();
-        }
-        for (int i = 0; i < progressBar.size(); ++i) {
-            progressBar[i]->show();
-        }
-        ui->BlueLight->show();
-        ui->RedLight->show();
-        ui->DotLight->show();
-        ui->GreenLight->show();
-        ui->BlueLightlabel->show();
-        ui->RedLightlabel->show();
-        ui->DotLightlabel->show();
-        ui->GreenLightlabel->show();
-    }else{
-        for (QLineEdit* lineEdit : lineEdits) {
-            lineEdit->hide();
-        }
-        for (int i = 0; i < sliders.size(); ++i) {
-            sliders[i]->hide();
-        }
-        for (int i = 0; i < progressBar.size(); ++i) {
-            progressBar[i]->hide();
-        }
-        ui->BlueLight->hide();
-        ui->RedLight->hide();
-        ui->DotLight->hide();
-        ui->GreenLight->hide();
-        ui->BlueLightlabel->hide();
-        ui->RedLightlabel->hide();
-        ui->DotLightlabel->hide();
-        ui->GreenLightlabel->hide();
-    }
-}
 
 void SingleCameraOperationWnd::startCamera(int cameraId) {
     m_grabber = new ImageGrabber(cameraId);
@@ -588,20 +271,20 @@ void SingleCameraOperationWnd::on_DatacomboBox_currentIndexChanged(int index){
     }
 
 }
-void SingleCameraOperationWnd::handleComBoxChange(int groupId,int index){
-    QSettings settings("YourCompany", "YourApplication_");
-    int currentGroupId = settings.value("GroupId", 0).toInt();
-    if(currentGroupId == groupId){
-        ui->DatacomboBox->setCurrentIndex(index);
-    }
-}
+//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){
     QPixmap pixmap = QPixmap::fromImage(image);
-    QSize size = ui->Operatewidget->size();
+    QSize size = ui->viewwidgetgroup->getOperatewidget()->size();
     // QPixmap scaledPixmap = pixmap.scaled(size, Qt::KeepAspectRatio, Qt::SmoothTransformation);
     QPixmap scaledPixmap = pixmap.scaled(size, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
-    ui->Operatewidget->setPixmap(scaledPixmap);
+    ui->viewwidgetgroup->getOperatewidget()->setPixmap(scaledPixmap);
 
 }
 

+ 3 - 16
View/die-bonder-ui/OriginalWnd/SingleCameraOperationWnd.h

@@ -25,31 +25,20 @@ public:
     ~SingleCameraOperationWnd();
 
     void initFrom();
-    void connectSliderAndLineEdit(QSlider* slider, QLineEdit* lineEdit);
-    void initSliders();
-    void initLineEdits();
-    void initProgressBar();
-    // void saveSliderStates();
-    // void loadSliderStates();
     void closeEvent(QCloseEvent *event) override;
 
     void loadGroupSettings(int Id, int Index);
 
-    void clearLayout(); // 清除大窗口上当前的布局
-    void WaferWidget(); // 圆晶
-    void WaffleWidget(); // 华夫盒
-    void MaterialBoxWidget(); // 料盒
 	void startCamera(int cameraId);
     void stopCamera(int cameraId);
     void updateImage(const QImage&image);
+    void updateMaterialWidget(int materialWndType, int groupId);
 public slots: // 确保这里声明了槽函数
     void onComboBoxIndexChanged(int index); // 确保签名匹配
     QString getImagePathFromIndex(int index);
-    void handleDoubleClick();
-    void showAndHideButton();
 
     void on_DatacomboBox_currentIndexChanged(int index);
-    void handleComBoxChange(int groupId,int index);
+    //void handleComBoxChange(int groupId,int index);
     void loadLiveVedio();
 protected:
     void wheelEvent(QWheelEvent *event) override;
@@ -59,14 +48,12 @@ protected:
     void hideEvent(QHideEvent *event) override;
 
 private slots:
-    void on_ZoomUpButton_clicked();
+
 
     QPixmap getCurrentPixmap() const {
         return currentPixmap;
     }
 
-    void on_ZoomOutButton_clicked();
-    void on_RulerButton_clicked();
 
 public:
     /**必须绑定它, 没必要一直new ,只是控制

+ 12 - 218
View/die-bonder-ui/OriginalWnd/SingleCameraOperationWnd.ui

@@ -20,29 +20,6 @@
    <enum>Qt::LeftToRight</enum>
   </property>
   <widget class="QWidget" name="centralwidget">
-   <widget class="QComboBox" name="DatacomboBox">
-    <property name="geometry">
-     <rect>
-      <x>20</x>
-      <y>20</y>
-      <width>400</width>
-      <height>32</height>
-     </rect>
-    </property>
-   </widget>
-   <widget class="ImageWidget" name="Operatewidget" native="true">
-    <property name="geometry">
-     <rect>
-      <x>20</x>
-      <y>72</y>
-      <width>786</width>
-      <height>786</height>
-     </rect>
-    </property>
-    <property name="styleSheet">
-     <string notr="true"/>
-    </property>
-   </widget>
    <widget class="Line" name="line_2">
     <property name="geometry">
      <rect>
@@ -56,19 +33,6 @@
      <enum>Qt::Vertical</enum>
     </property>
    </widget>
-   <widget class="QPushButton" name="LiveButton">
-    <property name="geometry">
-     <rect>
-      <x>436</x>
-      <y>20</y>
-      <width>60</width>
-      <height>32</height>
-     </rect>
-    </property>
-    <property name="text">
-     <string>Live</string>
-    </property>
-   </widget>
    <widget class="QScrollArea" name="scrollArea">
     <property name="geometry">
      <rect>
@@ -95,175 +59,6 @@
      </property>
     </widget>
    </widget>
-   <widget class="QWidget" name="Toolbar" native="true">
-    <property name="geometry">
-     <rect>
-      <x>22</x>
-      <y>882</y>
-      <width>786</width>
-      <height>32</height>
-     </rect>
-    </property>
-    <widget class="Line" name="line">
-     <property name="geometry">
-      <rect>
-       <x>140</x>
-       <y>8</y>
-       <width>1</width>
-       <height>16</height>
-      </rect>
-     </property>
-     <property name="orientation">
-      <enum>Qt::Vertical</enum>
-     </property>
-    </widget>
-    <widget class="QPushButton" name="ZoomUpButton">
-     <property name="geometry">
-      <rect>
-       <x>0</x>
-       <y>0</y>
-       <width>138</width>
-       <height>32</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string/>
-     </property>
-    </widget>
-    <widget class="Line" name="line_3">
-     <property name="geometry">
-      <rect>
-       <x>256</x>
-       <y>8</y>
-       <width>1</width>
-       <height>16</height>
-      </rect>
-     </property>
-     <property name="orientation">
-      <enum>Qt::Vertical</enum>
-     </property>
-    </widget>
-    <widget class="Line" name="line_4">
-     <property name="geometry">
-      <rect>
-       <x>395</x>
-       <y>8</y>
-       <width>1</width>
-       <height>16</height>
-      </rect>
-     </property>
-     <property name="orientation">
-      <enum>Qt::Vertical</enum>
-     </property>
-    </widget>
-    <widget class="Line" name="line_5">
-     <property name="geometry">
-      <rect>
-       <x>523</x>
-       <y>8</y>
-       <width>1</width>
-       <height>16</height>
-      </rect>
-     </property>
-     <property name="orientation">
-      <enum>Qt::Vertical</enum>
-     </property>
-    </widget>
-    <widget class="Line" name="line_6">
-     <property name="geometry">
-      <rect>
-       <x>635</x>
-       <y>8</y>
-       <width>1</width>
-       <height>16</height>
-      </rect>
-     </property>
-     <property name="orientation">
-      <enum>Qt::Vertical</enum>
-     </property>
-    </widget>
-    <widget class="QPushButton" name="pushButton_2">
-     <property name="geometry">
-      <rect>
-       <x>637</x>
-       <y>0</y>
-       <width>149</width>
-       <height>32</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string>.......</string>
-     </property>
-    </widget>
-    <widget class="QPushButton" name="ZoomOutButton">
-     <property name="geometry">
-      <rect>
-       <x>142</x>
-       <y>0</y>
-       <width>112</width>
-       <height>32</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string/>
-     </property>
-    </widget>
-    <widget class="QPushButton" name="RulerButton">
-     <property name="geometry">
-      <rect>
-       <x>397</x>
-       <y>0</y>
-       <width>124</width>
-       <height>32</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string/>
-     </property>
-    </widget>
-    <widget class="QPushButton" name="PenButton">
-     <property name="geometry">
-      <rect>
-       <x>525</x>
-       <y>0</y>
-       <width>108</width>
-       <height>32</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string/>
-     </property>
-    </widget>
-    <widget class="QLabel" name="label_Percentage">
-     <property name="geometry">
-      <rect>
-       <x>258</x>
-       <y>0</y>
-       <width>135</width>
-       <height>32</height>
-      </rect>
-     </property>
-     <property name="layoutDirection">
-      <enum>Qt::LeftToRight</enum>
-     </property>
-     <property name="text">
-      <string>100%</string>
-     </property>
-    </widget>
-   </widget>
-   <widget class="QWidget" name="BackGround" native="true">
-    <property name="geometry">
-     <rect>
-      <x>16</x>
-      <y>68</y>
-      <width>794</width>
-      <height>794</height>
-     </rect>
-    </property>
-    <property name="styleSheet">
-     <string notr="true">border: 4px solid red;</string>
-    </property>
-   </widget>
    <widget class="QWidget" name="RedLight" native="true">
     <property name="geometry">
      <rect>
@@ -536,24 +331,23 @@
      </property>
     </widget>
    </widget>
-   <zorder>BackGround</zorder>
-   <zorder>DatacomboBox</zorder>
-   <zorder>Operatewidget</zorder>
-   <zorder>line_2</zorder>
-   <zorder>LiveButton</zorder>
-   <zorder>scrollArea</zorder>
-   <zorder>Toolbar</zorder>
-   <zorder>RedLight</zorder>
-   <zorder>GreenLight</zorder>
-   <zorder>BlueLight</zorder>
-   <zorder>DotLight</zorder>
+   <widget class="ControlOperationPage" name="viewwidgetgroup" native="true">
+    <property name="geometry">
+     <rect>
+      <x>10</x>
+      <y>10</y>
+      <width>810</width>
+      <height>920</height>
+     </rect>
+    </property>
+   </widget>
   </widget>
  </widget>
  <customwidgets>
   <customwidget>
-   <class>ImageWidget</class>
+   <class>ControlOperationPage</class>
    <extends>QWidget</extends>
-   <header location="global">ImageWidget.h</header>
+   <header>src/RewriteControl/controloperationpage.h</header>
    <container>1</container>
   </customwidget>
  </customwidgets>

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

@@ -173,4 +173,28 @@ void ControlOperationPage::initForm() {
 }
 ImageWidget* ControlOperationPage::getOperatewidget() {
     return ui->Operatewidget;
+}
+
+void ControlOperationPage::resizeSingleUI() {
+    ui->DataSources->setGeometry(QRect(20, 20, 400, 32));
+    ui->Operatewidget->setGeometry(QRect(20, 72, 786, 786));
+    //ui->line_2->setGeometry(QRect(826, 20, 1, 953));
+    ui->LiveButton->setGeometry(QRect(436, 20, 60, 32));
+    ui->Toolbar->setGeometry(QRect(22, 882, 786, 32));
+    ui->line->setGeometry(QRect(140, 8, 1, 16));
+    ui->ZoomUpButton->setGeometry(QRect(0, 0, 138, 32));
+    ui->line_3->setGeometry(QRect(256, 8, 1, 16));
+    ui->line_4->setGeometry(QRect(395, 8, 1, 16));
+    ui->line_5->setGeometry(QRect(523, 8, 1, 16));
+    ui->line_6->setGeometry(QRect(635, 8, 1, 16));
+    ui->pushButton_2->setGeometry(QRect(637, 0, 149, 32));
+    ui->ZoomOutButton->setGeometry(QRect(142, 0, 112, 32));
+    ui->RulerButton->setGeometry(QRect(397, 0, 124, 32));
+    ui->PenButton->setGeometry(QRect(525, 0, 108, 32));
+    ui->label_Percentage->setGeometry(QRect(258, 0, 135, 32));
+    ui->BackGround->setGeometry(QRect(16, 68, 794, 794));
+}
+
+void ControlOperationPage::resizeChartsAndCamerasUI() {
+
 }

+ 2 - 0
View/die-bonder-ui/Src/RewriteControl/ControlOperationPage.h

@@ -38,6 +38,8 @@ public:
     void setMaterialBox(MaterialBox *materialbox);
     //void setBond(Bond *bond);
     ImageWidget* getOperatewidget();
+    void resizeSingleUI();
+    void resizeChartsAndCamerasUI();
 
 private slots:
     void on_ZoomUpButton_clicked();