Ver Fonte

Group逻辑修改

JonYang há 3 dias atrás
pai
commit
d4ea06c5da

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

@@ -65,19 +65,27 @@ Wafer* CameraImageHandler::getWafer() const{
 }
 
 Waffle* CameraImageHandler::getWaffle() const{
-    return waffle;
+    return m_pWaffle;
 }
 
 MaterialBox* CameraImageHandler::getMaterialBox() const
 {
-    return materialBox;
+    return m_pMaterialBox;
 }
 
 Bond* CameraImageHandler::getBond() const {
     return m_pBond;
 }
 
-void CameraImageHandler::initGroup(int CameraId) {
+void CameraImageHandler::initGroup(int CameraId) 
+{
+    /** 这里面为什么又在Group 里面创建一个呢? ,不能同步?
+     */
+    //CreateGroupData();
+
+
+
+
    /* int CameraId, QString path, enum MaterialWindowType materialWindowType*/
     QStringList dispmodel1;
     dispmodel1 << "P die align" << "D device align";
@@ -112,37 +120,67 @@ void CameraImageHandler::initGroup(int CameraId) {
     else if (CameraId == 2) 
     {
         MaterialWindowType = 2;
-        waffle = new Waffle(0);
+        m_pWaffle = new Waffle(0);
+        if (m_pCViewInterface != nullptr)
+        {
+            std::vector<ns_mat::WAFFLE_MATRIX_POINT_STRUCT> veWaffle;
+            m_pCViewInterface->GetWafflePackAllPointInfo(veWaffle);
+            m_pWaffle->UpdataVal(veWaffle);
+        }
+        else
+        {
+            m_pWaffle->UpdataGenerateTestData();
+        }
         m_pGroup = new Group(CameraId, ":/images/test_image/image_3.png", MaterialWindowType, dispmodel2, this);
     } 
     else if (CameraId == 3) 
     {
         MaterialWindowType = 3;
-        materialBox = new MaterialBox(0);
+        m_pMaterialBox = new MaterialBox(0);
         m_pGroup = new Group(CameraId, ":/images/test_image/image_5.png", MaterialWindowType, dispmodel3, this);
     } 
     else if (CameraId == 4) 
     {
-        MaterialWindowType = 1;
-        m_pWafer = new Wafer(0);
+       MaterialWindowType = 1;
+       m_pWafer = new Wafer(0);
+       if (m_pCViewInterface != nullptr)
+       {
+           std::vector<ns_mat::WAFER_MATRIX_POINT_INFO_STRUCT> veWafer;
+           m_pCViewInterface->GetWaferAllPointInfo(veWafer);
+           m_pWafer->UpdataVal(veWafer);
+       }
+       else
+       {
+           m_pWafer->UpdataGenerateTestData();
+       }
         m_pGroup = new Group(CameraId, ":/images/test_image/image_7.png", MaterialWindowType, dispmodel4, this);
     } 
     else if (CameraId == 5) 
     {
         MaterialWindowType = 1;
         m_pWafer = new Wafer(0);
+        if (m_pCViewInterface != nullptr)
+        {
+            std::vector<ns_mat::WAFER_MATRIX_POINT_INFO_STRUCT> veWafer;
+            m_pCViewInterface->GetWaferAllPointInfo(veWafer);
+            m_pWafer->UpdataVal(veWafer);
+        }
+        else
+        {
+            m_pWafer->UpdataGenerateTestData();
+        }
         m_pGroup = new Group(CameraId, ":/images/test_image/image_1.png", MaterialWindowType, dispmodel1, this);
     } 
     else if (CameraId == 6) 
     {
         MaterialWindowType = 2;
-        waffle = new Waffle(0);
+        m_pWaffle = new Waffle(0);
         m_pGroup = new Group(CameraId, ":/images/test_image/image_3.png", MaterialWindowType, dispmodel2, this);
     } 
     else if (CameraId == 7)
     {
         MaterialWindowType = 3;
-		materialBox = new MaterialBox(0);
+		m_pMaterialBox = new MaterialBox(0);
         m_pGroup = new Group(CameraId, ":/images/test_image/image_5.png", MaterialWindowType, dispmodel3, this);
     } 
     else if (CameraId == 8)
@@ -156,3 +194,112 @@ void CameraImageHandler::initGroup(int CameraId) {
         m_pGroup = nullptr; // 如果 CameraId 不匹配,则 group 为 nullptr
     }
 }
+
+void CameraImageHandler::CreateGroupData(const CameraInfo& cameraInfo)
+{
+    QString strPatch = R"(D:\config\MaterialInfo\)"; // 真实的路径 
+    switch (cameraInfo.iCameraId)
+    {
+       case 0: //TODO: yang
+       {
+           strPatch += CreateMaterialType(cameraInfo.eType);
+       }
+       break;
+       case 1:
+       {
+           strPatch += CreateMaterialType(cameraInfo.eType);
+       }
+       break;
+       case 2:
+       {
+           strPatch += CreateMaterialType(cameraInfo.eType);
+       }
+       break;
+       case 3:
+       {
+           strPatch += CreateMaterialType(cameraInfo.eType);
+       }
+       break;
+       case 4:
+       {
+           strPatch += CreateMaterialType(cameraInfo.eType);
+       }
+       break;
+       default:
+           break;
+    }
+
+    //m_pGroup = new Group(cameraInfo, strPatch, this);
+}
+
+QString CameraImageHandler::CreateMaterialType(MATERIAL_TYPE materialType)
+{
+    QString strLoadPatch;
+
+    switch (materialType)
+    {
+        case MATERIAL_NULL:
+        {
+
+        }
+        break;
+        case MATERIAL_WAFER:
+        {
+            strLoadPatch = "Wafer";
+            m_pWafer = new Wafer(0);  //TODO:以下传入指针实现同步?
+            if (m_pCViewInterface != nullptr)
+            {
+                std::vector<ns_mat::WAFER_MATRIX_POINT_INFO_STRUCT> veWafer;
+                m_pCViewInterface->GetWaferAllPointInfo(veWafer);
+                m_pWafer->UpdataVal(veWafer);
+            }
+            else
+            {
+                m_pWafer->UpdataGenerateTestData();
+            }
+        }
+        break;
+        case MATERIAL_WAFFLE:
+        {
+            strLoadPatch = "Waffle";
+            m_pWaffle = new Waffle(0);
+            if (m_pCViewInterface != nullptr)
+            {
+                std::vector<ns_mat::WAFFLE_MATRIX_POINT_STRUCT> veWaffle;
+                m_pCViewInterface->GetWafflePackAllPointInfo(veWaffle);
+                m_pWaffle->UpdataVal(veWaffle);
+            }
+            else
+            {
+                m_pWaffle->UpdataGenerateTestData();
+            }
+        }
+        break;
+        case MATERIAL_BOX:  //-----------------------------未提供
+        {
+            strLoadPatch = "MaterialBox";
+            m_pMaterialBox = new MaterialBox(0);
+        }
+        break;
+        case MATERIAL_BOND:
+        {
+            strLoadPatch = "Bond";
+            m_pBond = new Bond(0);
+            if (m_pCViewInterface != nullptr)
+            {
+                std::vector<ns_mat::POINT_INFO_STRUCT> stPointInfo;
+                m_pCViewInterface->GetBondAllPointInfo(stPointInfo);
+                m_pBond->UpdataVal(stPointInfo);
+            }
+            else
+            {
+                m_pBond->UpdataGenerateTestData();
+            }
+        }
+        break;
+        default:
+            break;
+    }
+
+    return strLoadPatch;
+}

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

@@ -32,6 +32,14 @@ private:
 
     void initGroup(int CameraId);
 
+    /**分组
+     */
+    void CreateGroupData(const CameraInfo& cameraInfo);
+
+    /**创建物料类型
+     */
+    QString CreateMaterialType(MATERIAL_TYPE materialType);
+
 private:
     /**存储 Group 对象的容器
      */
@@ -43,9 +51,9 @@ private:
 
     /**华夫盒
      */
-    Waffle* waffle = nullptr;
+    Waffle* m_pWaffle = nullptr;
 
-    MaterialBox* materialBox = nullptr;
+    MaterialBox* m_pMaterialBox = nullptr;
 
     Bond* m_pBond = nullptr;
 

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

@@ -5,6 +5,7 @@
 #include <QVBoxLayout>
 #include <QLabel>
 #include <QTimer>
+#include "QDir"
 
 // 静态变量初始化
 Group* Group::m_pCurrentlySelectedGroup = nullptr;
@@ -13,7 +14,9 @@ Group* Group::m_pLastClickedGroup = nullptr;
 int Group::m_stnLastClickedIndex = 0;
 int Group::m_stnLastSavedIndex = 1;
 
+// 没看懂,为啥要这么传
 Group::Group(int Id, const QString& imagePath1, int MaterialWindowType, const QStringList& textList, QWidget* parent)
+//Group::Group(const CameraInfo& cameraInfo, QWidget* parent)
     : QWidget(parent), ui(new Ui::Group), m_nGroupId(Id)
 {
     ui->setupUi(this);
@@ -21,6 +24,9 @@ Group::Group(int Id, const QString& imagePath1, int MaterialWindowType, const QS
     QPixmap pixmap1(imagePath1);
     ui->Imagewidget_left->setPixmap(pixmap1);
 
+
+    //初始化目录名称
+    //ui->DatacomboBox->addItems(getFileNames(strPatch));
     ui->DatacomboBox->addItems(textList);
     ui->GroupButton->setStyleSheet(
         "QPushButton:hover {"
@@ -55,6 +61,8 @@ Group::Group(int Id, const QString& imagePath1, int MaterialWindowType, const QS
         BondWidget();
     }
 
+    // 没看懂,列表保存干啥?
+    //saveGroupSettings(Id, imagePath1, MaterialWindowType, strPatch);
     saveGroupSettings(Id, imagePath1, MaterialWindowType, textList);
     connect(ui->GroupButton, &QPushButton::clicked, this, &Group::onclickbutton);
     initForm();
@@ -219,6 +227,29 @@ void Group::BondWidget()
     layout2->addWidget(pixmapLabel);
 }
 
+QStringList Group::getFileNames(const QString& dirPath)
+{
+    QStringList fileNames;
+    QDir dir(dirPath);
+
+    // 检查目录是否存在
+    if (!dir.exists())
+    {
+        return fileNames;
+    }
+
+    // 列出目录中的所有文件
+    dir.setFilter(QDir::Files); 
+    QFileInfoList fileInfoList = dir.entryInfoList();
+
+    for (const QFileInfo& fileInfo : fileInfoList) 
+    {
+        fileNames << fileInfo.fileName();
+    }
+
+    return fileNames;
+}
+
 void Group::onclickbutton(){
     QSettings settings("YourCompany", "YourApplication_Button");
     settings.setValue("GroupId_button", m_nGroupId);

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

@@ -17,8 +17,10 @@ class Group : public QWidget
     Q_OBJECT
 
 public:
-    // 相机ID 实时图片 物料窗口类型 下拉框文本
+    // 需要修改
+    //explicit Group(const CameraInfo& cameraInfo, QWidget* parent);
     explicit Group(int Id, const QString& imagePath1, int MaterialWindowType, const QStringList& textList, QWidget* parent);
+
     ~Group();
 
     void initForm();
@@ -63,6 +65,7 @@ protected:
     void MaterialBoxWidget(); // 料盒
     void BondWidget();
 
+    QStringList getFileNames(const QString& dirPath);
 private:
     Ui::Group *ui;
 

+ 6 - 9
View/die-bonder-ui/CameraMaterialGroupWnd/MaterialWindow/MaterialBox.cpp

@@ -1,8 +1,8 @@
 #include "MaterialBox.h"
 
 // 构造函数
-MaterialBox::MaterialBox(int flag, QWidget *parent) : QWidget(parent) {
-    // 初始化料盒数据
+MaterialBox::MaterialBox(int flag, QWidget *parent) : QWidget(parent)
+{
     boxes = {
         2,      // iCurrLayers
         32,      // iLayersTotal
@@ -16,20 +16,17 @@ MaterialBox::MaterialBox(int flag, QWidget *parent) : QWidget(parent) {
 }
 
 // 绘制事件
-void MaterialBox::paintEvent(QPaintEvent *event) {
+void MaterialBox::paintEvent(QPaintEvent *event)
+{
     QPainter painter(this);
     painter.setRenderHint(QPainter::Antialiasing);
 
     // 设置背景颜色
     painter.fillRect(this->rect(), Qt::white);
-
-
-
-
 }
-void MaterialBox::paintInitFrom(QWidget *parent) {
-
 
+void MaterialBox::paintInitFrom(QWidget *parent)
+{
     // 主容器尺寸(占窗口80%)
     const int containerWidthdp = parent->width() * 0.25;
     const int containerHeightdp = parent->height() * 0.05;

+ 1 - 1
View/die-bonder-ui/CameraMaterialGroupWnd/MaterialWindow/MaterialBox.h

@@ -32,7 +32,7 @@ typedef struct
     int iBelowWall;                 //下壁厚
 }MATERIAL_BOX_STRUCT;
 
-// 自定义绘制窗口类
+// 料盒
 class MaterialBox : public QWidget {
 public:
     MaterialBox(int flag, QWidget *parent = nullptr);

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

@@ -7,7 +7,12 @@
 #include <QGridLayout>
 
 Wafer::Wafer(int flag, QWidget *parent) : QWidget(parent) {
-    Flag = flag;
+   
+}
+
+void Wafer::UpdataGenerateTestData()
+{
+    Flag = 0;
     rows = 51;
     cols = 51;
     centerX = 25;
@@ -43,7 +48,8 @@ Wafer::Wafer(int flag, QWidget *parent) : QWidget(parent) {
             // 判断该点是否在圆形区域的边缘
             if (distance > radius - 1 && distance < radius + 1) {
                 point.eStatus = ns_mat::PICK_DIE_STATUS::EDGE_DIE; // 如果在边缘区域,状态设置为EDGE_DIE
-            } else {
+            }
+            else {
                 // 如果在圆形区域内,随机设置其他状态
                 int randomStatus = std::rand() % 4; // 随机选取DIE_EXIST, PICK_ING, NO_EXIST, SKIP_DIE
                 point.eStatus = static_cast<ns_mat::PICK_DIE_STATUS>(randomStatus);
@@ -55,6 +61,14 @@ Wafer::Wafer(int flag, QWidget *parent) : QWidget(parent) {
     }
 }
 
+void Wafer::UpdataVal(const std::vector<ns_mat::WAFER_MATRIX_POINT_INFO_STRUCT>& veWafer)
+{
+    for (const auto a : veWafer)
+    {
+        waferData.append(a);
+    }
+}
+
 QColor Wafer::getColorByStatus(ns_mat::PICK_DIE_STATUS status) {
     switch (status) {
     case ns_mat::PICK_DIE_STATUS::DIE_EXIST: return QColor(0, 102, 255); // 蓝色

+ 5 - 0
View/die-bonder-ui/CameraMaterialGroupWnd/MaterialWindow/Wafer.h

@@ -20,6 +20,11 @@ class Wafer : public QWidget
 public:
     explicit Wafer(int flag, QWidget *parent = nullptr);
 
+    void UpdataGenerateTestData();
+    /**晶圆
+    */
+    void UpdataVal(const std::vector<ns_mat::WAFER_MATRIX_POINT_INFO_STRUCT>& veWafer);
+
     void initFrom(QWidget *parent);
     void paintInitFrom(QWidget *parent);
     QPixmap getGlobalPixmap() const;

+ 38 - 25
View/die-bonder-ui/CameraMaterialGroupWnd/MaterialWindow/Waffle.cpp

@@ -2,24 +2,30 @@
 #include <QPainter>
 #include <QPaintEvent>
 
-Waffle::Waffle(int flag, QWidget *parent) : QWidget(parent) {
+Waffle::Waffle(int flag, QWidget *parent) : QWidget(parent) 
+{ 
+
+}
+
+void Waffle::UpdataGenerateTestData()
+{
     // //根据不同窗口设置不同大小 0:小 1:中 2:大
-    // if (flag == 0) {
-    //     // 华夫台的参数
-    //     gridSize = 5;  // 每个格子的大小
-    //     gap = 3;        // 格子之间的间隙
-    //     boxGap = 6;    // 华夫台之间的间隙
-    // } else if (flag == 1) {
-    //     // 华夫台的参数
-    //     gridSize = 20;  // 每个格子的大小
-    //     gap = 6;        // 格子之间的间隙
-    //     boxGap = 12;    // 华夫台之间的间隙
-    // } else if (flag == 2) {
-    //     // 华夫台的参数
-    //     gridSize = 50;  // 每个格子的大小
-    //     gap = 6;        // 格子之间的间隙
-    //     boxGap = 12;    // 华夫台之间的间隙
-    // }
+   // if (flag == 0) {
+   //     // 华夫台的参数
+   //     gridSize = 5;  // 每个格子的大小
+   //     gap = 3;        // 格子之间的间隙
+   //     boxGap = 6;    // 华夫台之间的间隙
+   // } else if (flag == 1) {
+   //     // 华夫台的参数
+   //     gridSize = 20;  // 每个格子的大小
+   //     gap = 6;        // 格子之间的间隙
+   //     boxGap = 12;    // 华夫台之间的间隙
+   // } else if (flag == 2) {
+   //     // 华夫台的参数
+   //     gridSize = 50;  // 每个格子的大小
+   //     gap = 6;        // 格子之间的间隙
+   //     boxGap = 12;    // 华夫台之间的间隙
+   // }
     rows = 6;
     cols = 18;
     centerX = 25;
@@ -42,10 +48,17 @@ Waffle::Waffle(int flag, QWidget *parent) : QWidget(parent) {
             int randomStatus = std::rand() % 5; // 随机选取DIE_EXIST, PICK_ING, NO_EXIST, SKIP_DIE
             point.eStatus = static_cast<ns_mat::PICK_DIE_STATUS>(randomStatus);
             // 将点添加到waferData容器中
-            waffleData.append(point);
+            m_vWaffleData.append(point);
         }
     }
+}
 
+void Waffle::UpdataVal(const std::vector<ns_mat::WAFFLE_MATRIX_POINT_STRUCT>& veWaffle)
+{
+    for (const auto a: veWaffle)
+    {
+        m_vWaffleData.append(a);
+    }
 }
 
 void Waffle::paintEvent(QPaintEvent *event) {
@@ -136,12 +149,12 @@ void Waffle::paintInitFrom(QWidget *parent) {
     painter.setPen(Qt::NoPen);
 
     // 绘制每个晶圆点
-    for (int i = 0; i < waffleData.size(); ++i) {
-        int x = offsetX + waffleData[i].nDieCol * cellSize;
-        int y = offsetY + waffleData[i].nDieRow * cellSize;
+    for (int i = 0; i < m_vWaffleData.size(); ++i) {
+        int x = offsetX + m_vWaffleData[i].nDieCol * cellSize;
+        int y = offsetY + m_vWaffleData[i].nDieRow * cellSize;
 
         // 根据点的状态设置颜色
-        painter.setBrush(getColorByStatus(waffleData[i].eStatus));
+        painter.setBrush(getColorByStatus(m_vWaffleData[i].eStatus));
 
         // 绘制晶圆点(每个点是一个矩形)
         painter.drawRect(x, y, cellSize, cellSize);
@@ -163,9 +176,9 @@ void Waffle::initFrom(QWidget *parent) {
     // 根据行列数计算每个晶圆点的大小,选择小的边来决定
     int cellSize = qMin(width, height) / qMax(rows, cols); // 固定大小为正方形,按最小边计算
 
-    for (int i = 0; i < waffleData.size(); ++i) {
-        DieItem* die = new DieItem(waffleData[i].nDieRow, waffleData[i].nDieCol, waffleData[i].eStatus, cellSize);
-        die->setPos(waffleData[i].nDieCol * cellSize, waffleData[i].nDieRow * cellSize);
+    for (int i = 0; i < m_vWaffleData.size(); ++i) {
+        DieItem* die = new DieItem(m_vWaffleData[i].nDieRow, m_vWaffleData[i].nDieCol, m_vWaffleData[i].eStatus, cellSize);
+        die->setPos(m_vWaffleData[i].nDieCol * cellSize, m_vWaffleData[i].nDieRow * cellSize);
         scene->addItem(die);
     }
 

+ 8 - 1
View/die-bonder-ui/CameraMaterialGroupWnd/MaterialWindow/Waffle.h

@@ -14,6 +14,12 @@ class Waffle : public QWidget
 public:
     Waffle(int flag, QWidget *parent = nullptr);
 
+    void UpdataGenerateTestData();
+
+    /**更新华夫台
+     */
+    void UpdataVal(const std::vector<ns_mat::WAFFLE_MATRIX_POINT_STRUCT>& veWaffle);
+
 
     void paintEvent(QPaintEvent *event) override;
     QColor getColorByStatus(ns_mat::PICK_DIE_STATUS status);
@@ -34,7 +40,8 @@ private:
     int boxRows = 3;    // 华夫盒的行数
     int boxCols = 4;    // 华夫盒的列数
     int boxGap;    // 华夫台之间的间隙
-    QVector<ns_mat::WAFFLE_MATRIX_POINT_STRUCT> waffleData;
+    QVector<ns_mat::WAFFLE_MATRIX_POINT_STRUCT> m_vWaffleData;
+
     int centerX, centerY;
     QPixmap globalPixmap;
 

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

@@ -223,6 +223,8 @@ void MainAndSecondaryCamerasWnd::initLeftAndRightWidget() {
     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();

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

@@ -361,17 +361,17 @@ void ControlOperationPage::on_axisTypeComboBox_currentIndexChanged(int index)
     }
 }
 
-//void ControlOperationPage::timerEvent(QTimerEvent* event)
-//{
-//    int nID = event->timerId();
-//    if (nID == m_idleTimer)
-//    {
-//        ResetIdleTimer(false);
-//        m_isUserOnclick = false;
-//        ui->switchJoystickBut->setEnabled(true);
-//    }
-//}
-//
+void ControlOperationPage::timerEvent(QTimerEvent* event)
+{
+    int nID = event->timerId();
+    if (nID == m_idleTimer)
+    {
+        ResetIdleTimer(false);
+        m_isUserOnclick = false;
+        ui->switchJoystickBut->setEnabled(true);
+    }
+}
+
 //void ControlOperationPage::mousePressEvent(QMouseEvent* event)
 //{
 //    if (event->button() == Qt::LeftButton)

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

@@ -85,9 +85,9 @@ private slots:
     
 
 protected:
-    /*void timerEvent(QTimerEvent* event) override;
+    void timerEvent(QTimerEvent* event) override;
 
-    void mousePressEvent(QMouseEvent* event) override;
+    /*void mousePressEvent(QMouseEvent* event) override;
 
     void mouseMoveEvent(QMouseEvent* event) override;*/
     void wheelEvent(QWheelEvent* event) override;

+ 12 - 2
View/die-bonder-ui/Src/RewriteControl/LightJoystickSwitchPage.cpp

@@ -171,6 +171,7 @@ void LightJoystickSwitchPage::on_down_Button_clicked()
 
 void LightJoystickSwitchPage::GetModuleTypeSlots(const ST_MOVE_AXIS& _module)
 {
+    m_isSlots = true;
     SetMoveJoystickInfo(_module);
 }
 
@@ -191,8 +192,17 @@ void LightJoystickSwitchPage::UpdatemPageGroup(Group* pGroup)
 void LightJoystickSwitchPage::SwitchJoystickPage(bool bSwitch)
 {
     ResetIdleTimer(bSwitch);
-    int newIndex = (ui->switchTabWidget->currentIndex() + 1) % ui->switchTabWidget->count();
-    ui->switchTabWidget->setCurrentIndex(newIndex);
+    //int newIndex = (ui->switchTabWidget->currentIndex() + 1) % ui->switchTabWidget->count();
+    if (m_isSlots)
+    {
+        ui->switchTabWidget->setCurrentIndex(1);
+    }
+    else
+    {
+        ui->switchTabWidget->setCurrentIndex(0);
+    }
+    
+    m_isSlots = false;
 }
 
 void LightJoystickSwitchPage::HideOrShowPage(bool isHide)

+ 1 - 0
View/die-bonder-ui/Src/RewriteControl/LightJoystickSwitchPage.h

@@ -117,6 +117,7 @@ private:
     */
     int                         m_idleTimer     = -1;
     int                         m_nTimeShowPos  = -1;
+    bool                        m_isSlots = false;
 };
 
 #endif // SWITCHTABBASEWIDGET_H