Parcourir la source

Merge branch 'master' of http://47.116.26.105:10880/JonYang/JSBTDieBondH

yun il y a 3 heures
Parent
commit
33aa9a237e

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

@@ -134,6 +134,18 @@ QString CameraImageHandler::CreateMaterialType(MATERIAL_TYPE materialType)
         {
             strLoadPatch = "MaterialBox";
             m_pMaterialBox = new MaterialBox(0);
+            if (m_pCViewInterface != nullptr)
+            {
+                std::vector<ns_module::MATERIAL_BOX_STRUCT> veMaterial;
+
+                m_pCViewInterface->GetMaterialBoxAllPointInfo(veMaterial);
+                m_pMaterialBox->UpdataVal(veMaterial);
+            }
+            else
+            {
+                m_pMaterialBox->UpdataGenerateTestData();
+            }
+
         }
         break;
         case MATERIAL_BOND:

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

@@ -76,6 +76,18 @@ Group::Group(int groupId,const CameraInfo& cameraInfo, ns_module::CViewInterface
     else if (cameraInfo.eType == 3) 
     {
         m_pMaterialbox = new MaterialBox(0, ui->Imagewidget_right);
+        if (m_pCViewInterface != nullptr)
+        {
+            std::vector<ns_module::MATERIAL_BOX_STRUCT> veMaterial;
+
+            m_pCViewInterface->GetMaterialBoxAllPointInfo(veMaterial);
+            m_pMaterialbox->UpdataVal(veMaterial);
+        }
+        else
+        {
+            m_pMaterialbox->UpdataGenerateTestData();
+        }
+
         MaterialBoxWidget();
     }
     else if (cameraInfo.eType == 4)

+ 63 - 36
View/die-bonder-ui/CameraMaterialGroupWnd/MaterialWindow/MaterialBox.cpp

@@ -1,17 +1,10 @@
 #include "MaterialBox.h"
 
 // 构造函数
-MaterialBox::MaterialBox(int flag, QWidget *parent) : QWidget(parent)
+MaterialBox::MaterialBox(int flag, QWidget *parent) : 
+    QWidget(parent)
 {
-    boxes = {
-        2,      // iCurrLayers
-        32,      // iLayersTotal
-        100,    // iTopLev
-        50,     // iBottomLev
-        {15.5, 20.3}, // 补全所有子成员
-        {1,0,1,1,0},
-        // ...后续成员保持相同
-    };
+    
 
 }
 
@@ -52,22 +45,28 @@ void MaterialBox::paintInitFrom(QWidget *parent)
     int innerY = containerHeightdp + 5;
 
     // 根据层数自动计算间距和矩形高度
-    const int totalLayers = boxes.iLayersTotal;
+    const int totalLayers = m_boxes.iLayersTotal;
     const float spacing = static_cast<float>((static_cast<float>(innerHeight -totalLayers)) /static_cast<float>(totalLayers)); // 每个矩形之间的固定间距(像素)
-    qDebug()<<spacing;
+    //qDebug()<<spacing;
     float rectHeight =  2.5;
     const float rectWeight = static_cast<float>(innerWidth);
-    if((0<=totalLayers)&&(totalLayers<=8)){
+    if ((0 <= totalLayers) && (totalLayers <= 8))
+    {
         rectHeight =  2.5;
-    }else if((9<=totalLayers)&&(totalLayers<=16)){
+    }
+    else if((9<=totalLayers)&&(totalLayers<=16))
+    {
         rectHeight =  1.5;
-    }else{
+    }
+    else
+    {
         rectHeight =  1;
     }
 
     // 逐层绘制状态矩形
-    for(int i = 0; i < totalLayers; ++i) {
-        const QColor color = boxes.iStatas[i] ? QColor(40, 129, 5) : QColor(255, 0, 0); // 1=绿,0=红
+    for(int i = 0; i < totalLayers; ++i)
+    {
+        const QColor color = m_boxes.iStatas[i] ? QColor(40, 129, 5) : QColor(255, 0, 0); // 1=绿,0=红
         const int yPos = innerY + i * (rectHeight + spacing);
         painter.setPen(Qt::NoPen); // 去掉边框
         painter.setBrush(color);
@@ -76,12 +75,13 @@ void MaterialBox::paintInitFrom(QWidget *parent)
 
 }
 
-QPixmap MaterialBox::getGlobalPixmap() const {
+QPixmap MaterialBox::getGlobalPixmap() const 
+{
     return globalPixmap;
 }
 
-void MaterialBox::initFrom(QWidget *parent){
-
+void MaterialBox::initFrom(QWidget *parent)
+{
     int ratio = parent->height()/100;
     // 主容器尺寸(占窗口80%)
     // qDebug()<<ratio;
@@ -97,37 +97,64 @@ void MaterialBox::initFrom(QWidget *parent){
     int innerY = containerHeightdp + 5*ratio;
 
     // 根据层数自动计算间距和矩形高度
-    const int totalLayers = boxes.iLayersTotal;
+    const int totalLayers = m_boxes.iLayersTotal;
     const float spacing = static_cast<float>((static_cast<float>(innerHeight -totalLayers*ratio)) /static_cast<float>(totalLayers)); // 每个矩形之间的固定间距(像素)
-    qDebug()<<spacing;
+    //qDebug()<<spacing;
     float rectHeight =  2.5*ratio;
     const float rectWeight = static_cast<float>(innerWidth);
-    if((0<=totalLayers)&&(totalLayers<=8)){
+    if((0<=totalLayers)&&(totalLayers<=8))
+    {
         rectHeight =  2.5*ratio;
-    }else if((9<=totalLayers)&&(totalLayers<=16)){
+    }
+    else if((9<=totalLayers)&&(totalLayers<=16))
+    {
         rectHeight =  1.5*ratio;
-    }else{
+    }
+    else
+    {
         rectHeight =  1*ratio;
     }
 
     BackgroundRect* backgroundRect = new BackgroundRect(containerWidthdp, containerHeightdp, containerWidth, containerHeight);
-    scene = new QGraphicsScene(parent);
-    view = new MaterialBoxGraphicsView(scene);
-    scene->addItem(backgroundRect);
-    for (int i = 0; i < totalLayers; ++i) {
-        MaterialBoxDie* materialBoxDie = new MaterialBoxDie(i, 0, boxes.iStatas[i],rectWeight, rectHeight);
+    m_pScene = new QGraphicsScene(parent);
+    m_pView = new MaterialBoxGraphicsView(m_pScene);
+    m_pScene->addItem(backgroundRect);
+    for (int i = 0; i < totalLayers; ++i) 
+    {
+        MaterialBoxDie* materialBoxDie = new MaterialBoxDie(i, 0, m_boxes.iStatas[i],rectWeight, rectHeight);
         materialBoxDie->setPos(innerX,(innerY+ i * (rectHeight + spacing) ));
-        scene->addItem(materialBoxDie);
+        m_pScene->addItem(materialBoxDie);
 
     }
-    connect(view, &MaterialBoxGraphicsView::layerRightClicked, this, &MaterialBox::handleLayerRightClicked);
-    view->resize(parent->width(), parent->height());
-    view->resetTransform();
-    view->setSceneRect(0, 0, parent->width(), parent->height());
+    connect(m_pView, &MaterialBoxGraphicsView::layerRightClicked, this, &MaterialBox::handleLayerRightClicked);
+    m_pView->resize(parent->width(), parent->height());
+    m_pView->resetTransform();
+    m_pView->setSceneRect(0, 0, parent->width(), parent->height());
+}
 
+void MaterialBox::UpdataVal(std::vector<ns_module::MATERIAL_BOX_STRUCT>& veMaterial)
+{
+    for (auto& a : veMaterial)
+    {
+        m_boxes = a;
+    }
+}
 
+void MaterialBox::UpdataGenerateTestData()
+{
+    m_boxes = {
+        2,      // iCurrLayers
+        32,      // iLayersTotal
+        100,    // iTopLev
+        50,     // iBottomLev
+        {15.5, 20.3}, // 补全所有子成员
+        {1,0,1,1,0},
+        // ...后续成员保持相同
+    };
 }
-void MaterialBox::handleLayerRightClicked(int layer) {
+
+void MaterialBox::handleLayerRightClicked(int layer)
+{
     qDebug() << "Right-clicked on layer:" << layer;
     // 在这里可以添加其他处理逻辑,例如发送信号到其他对象
 }

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

@@ -11,44 +11,45 @@
 #include "MaterialBoxGraphicsView.h"
 #include <QFrame>
 #include <dt.h>
+#include "CViewInterface.h"
 // 枚举定义:料盒的状态
 enum BoxStatus {
     Idle,       // 空闲
     Occupied,   // 已占用
 };
 
-typedef struct
-{
-    int iCurrLayers;				//当前工作层
-    int iLayersTotal;               //总层数
-    int iTopLev;                    //最上层高度
-    int iBottomLev;                 //最下层高度
-    XY_DOUBLE_STRUCT stPos;         //料盒位置;
-    int iStatas[32];				//每层状态,0表示空,1表示有料。
-    int iLength;                    //料盒长度
-    int iLeight;                    //料盒高度
-    int iWall;                      //侧壁厚
-    int iTopWall;                   //上壁厚
-    int iBelowWall;                 //下壁厚
-}MATERIAL_BOX_STRUCT;
-
 // 料盒
-class MaterialBox : public QWidget {
+class MaterialBox : public QWidget 
+{
 public:
     MaterialBox(int flag, QWidget *parent = nullptr);
+
     void paintInitFrom(QWidget *parent);
+
     QPixmap getGlobalPixmap() const;
+
     void initFrom(QWidget *parent);
-    MaterialBoxGraphicsView* view;
-    QGraphicsScene* scene;
+
+    void UpdataVal(std::vector<ns_module::MATERIAL_BOX_STRUCT>& veMaterial);
+
+    void UpdataGenerateTestData();
+
 private slots:
     void handleLayerRightClicked(int layer);
+
 protected:
     void paintEvent(QPaintEvent *event) override;
 
 private:
-    MATERIAL_BOX_STRUCT boxes; // 所有料盒的数据
-    QPixmap globalPixmap;
+    // 所有料盒的数据
+    ns_module::MATERIAL_BOX_STRUCT  m_boxes; 
+
+    QPixmap                         globalPixmap;
+
+public:
+    MaterialBoxGraphicsView*        m_pView = nullptr;
+
+    QGraphicsScene*                 m_pScene = nullptr;
 };
 
 #endif // MATERIALBOX_H

+ 6 - 9
View/die-bonder-ui/SBTdie-bonder-ui.pro

@@ -6,30 +6,27 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
 
 CONFIG += c++17
 
-#LIBS += -L"D:\qt\Interface_1.1" -lInterface
-# LIBS += -L"C:\Users\David\Desktop\Interface_1.1" -lInterface
-
 # You can make your code fail to compile if it uses deprecated APIs.
 # In order to do so, uncomment the following line.
 #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
 
 
-# SOURCES += $$files(src/*.cpp, $$PWD)
-# HEADERS += $$files(include/*.h, $$PWD)
-
+SOURCES += $$files(*.cpp, $$PWD)
+HEADERS += $$files(*.h, $$PWD)
+FORMS   += $$files(*.ui, $$PWD)
 
 SOURCES += $$files(*.cpp, $$PWD) \
-    Src/RewriteControl/Controls/JReLineEdit.cpp \
+    Src/RewriteControl/LightJoystickSwitchPage.cpp \
     Src/RewriteControl/MsgDlg/CustomMessageDlg.cpp \
     Src/RewriteControl/SpeedAdjPage.cpp \
     Src/RewriteControl/SpeedAdjWnd.cpp
 HEADERS += $$files(*.h, $$PWD) \
-    Src/RewriteControl/Controls/JReLineEdit.h \
+    Src/RewriteControl/LightJoystickSwitchPage.h \
     Src/RewriteControl/MsgDlg/CustomMessageDlg.h \
     Src/RewriteControl/SpeedAdjPage.h \
     Src/RewriteControl/SpeedAdjWnd.h
 FORMS   += $$files(*.ui, $$PWD) \
-    Src/RewriteControl/MsgDlg/CustomMessageDlg.ui \
+    Src/RewriteControl/LightJoystickSwitchPage.ui \
     Src/RewriteControl/SpeedAdjPage.ui \
     Src/RewriteControl/SpeedAdjWnd.ui
 

+ 17 - 0
View/die-bonder-ui/Src/CameraBind.cpp

@@ -94,6 +94,23 @@ void CameraBind::SetModuleMove(const std::string& strModuleType, const std::stri
     }
 }
 
+void CameraBind::JModuleMove(std::string ModuleType, std::vector<ns_module::MODULE_COORD_MOVE> vecPos, bool bMoveTo)
+{
+    if (m_pCViewInterface == nullptr)
+    {
+        return;
+    }
+
+    if (bMoveTo)
+    {
+        m_pCViewInterface->ModuleMoveTo(ModuleType, vecPos);
+    }
+    else
+    {
+        m_pCViewInterface->ModuleMove(ModuleType, vecPos);
+    }
+}
+
 void CameraBind::JToHome()
 {
     if (m_pCViewInterface == nullptr)

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

@@ -62,6 +62,7 @@ public:
     /**ÒÆ¶¯Öá
      */
     void SetModuleMove(const std::string& strModuleType, const std::string& enAxisType, double pos, bool bMoveTo);
+    void JModuleMove(std::string ModuleType, std::vector<ns_module::MODULE_COORD_MOVE> vecPos, bool bMoveTo);
 
     /**»ØÁã
      */

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

@@ -196,8 +196,8 @@ void ControlOperationPage::KindsofWidget(kinds kind)
         {
             isRun = true;
             m_materialbox->initFrom(ui->Operatewidget);
-            layout->addWidget(m_materialbox->view);
-            m_currentView = m_materialbox->view;
+            layout->addWidget(m_materialbox->m_pView);
+            m_currentView = m_materialbox->m_pView;
         }
 
     }

+ 119 - 4
View/die-bonder-ui/Src/RewriteControl/Controls/JReLineEdit.cpp

@@ -1,5 +1,8 @@
 #include "JReLineEdit.h"
-#include "../SpeedAdjPage.h"
+#include <QGroupBox>
+#include <QComboBox>
+#include <QCheckBox>
+#include <qDebug>
 
 JReLineEdit::JReLineEdit(QWidget* parent /*= nullptr*/)
     : QLineEdit(parent) 
@@ -11,14 +14,126 @@ void JReLineEdit::upDataValLine(const ST_DEF_VAL _val)
     m_stSavedefVal = _val;
 }
 
+void JReLineEdit::CheckVal()
+{
+    // 获取按钮所在的父窗口
+    QWidget* parentWindow = this->window();
+
+    QList<QGroupBox*> pListBox = parentWindow->findChildren<QGroupBox*>();
+    QList<QComboBox*> pListQComboBox = parentWindow->findChildren<QComboBox*>();
+    // 遍历所有QLineEdit
+    foreach(QGroupBox * p, pListBox)
+    {
+        if (p->objectName() == "axisGroupBox")
+        {
+            // 获取所有子控件
+            QList<QWidget*> children = p->findChildren<QWidget*>();
+
+            std::vector<ns_module::MODULE_COORD_MOVE> vecPos;
+            int nNum = 0;
+            // 总共没几个
+            ns_module::MODULE_COORD_MOVE axisPos = {};
+            foreach(QWidget * child, children) 
+            {
+                if (child->metaObject()->className() == "QCheckBox")
+                {
+                    QCheckBox* checkBox = qobject_cast<QCheckBox*>(child);
+                    if (checkBox) 
+                    {
+                        // 转换成功,可以安全使用 checkBox
+                        if (checkBox->isChecked())
+                        {
+                            nNum += 1;
+                            if (checkBox->objectName() == "forceCheckBox")
+                            {
+                                
+                            }
+                            else if (checkBox->objectName() == "forceCheckBox")
+                            {
+
+                            }
+                            else if (checkBox->objectName() == "forceCheckBox")
+                            {
+
+                            }
+                            else if (checkBox->objectName() == "forceCheckBox")
+                            {
+
+                            }
+                            break;
+                        }
+                    }
+                    else 
+                    {
+                        // 转换失败,widget 不是 QCheckBox 类型
+                        //qDebug() << "该 widget 不是 QCheckBox";
+                    }
+                }
+
+                // 表示是另一个控件
+                if (nNum == 1)
+                {
+                    QCheckBox* checkBox = qobject_cast<QCheckBox*>(child);
+                    
+                    axisPos.pos = checkBox->text().toDouble();
+                    vecPos.push_back(axisPos);
+                    nNum = 0;
+                }
+                
+                //qDebug() << "name :" << child->objectName()
+                //    << " type::" << child->metaObject()->className();
+            }
+            break;
+        }
+    }
+
+    // 获取选中
+    foreach(QComboBox* p, pListQComboBox)
+    {
+        if (p->objectName() == "modeComboBox")
+        {
+            m_stSavedefVal.strMode = p->currentText();
+        }
+    }
+
+    CreateSpeedAdjPage();
+}
+
+void JReLineEdit::CreateSpeedAdjPage()
+{
+    if (m_pSpeedWnd)
+    {
+        m_pSpeedWnd->close();
+        m_pSpeedWnd->deleteLater();
+    }
+    m_pSpeedWnd = new SpeedAdjPage(this);
+    m_pSpeedWnd->updateDefVal(m_stSavedefVal);
+    m_pSpeedWnd->setAttribute(Qt::WA_DeleteOnClose);
+    {
+        QPoint mousePos = QCursor::pos();
+        QPoint newPos = QPoint(mousePos.x() - m_pSpeedWnd->width() / 2,
+            mousePos.y() - m_pSpeedWnd->height() - 10);
+        m_pSpeedWnd->move(newPos);
+    }
+    connect(m_pSpeedWnd, &SpeedAdjPage::CloseWnd, this, &JReLineEdit::GetCloseWndSlots);
+
+    m_pSpeedWnd->show();
+}
+
+void JReLineEdit::GetCloseWndSlots(int nVal)
+{
+    double doVal = text().toDouble();
+    doVal = doVal + nVal;
+    setText(QString::number(doVal, 'f', 2));
+}
+
 void JReLineEdit::mousePressEvent(QMouseEvent* event)
 {
     if (event->button() == Qt::LeftButton) 
     {
-        SpeedAdjPage* pNew = new SpeedAdjPage(this);        
-        pNew->updateDefVal(m_stSavedefVal);
-        pNew->show();
+        CheckVal();
     }
+
     QLineEdit::mousePressEvent(event);
 }
 

+ 15 - 1
View/die-bonder-ui/Src/RewriteControl/Controls/JReLineEdit.h

@@ -9,9 +9,10 @@
 // *****************************************************************************
 #ifndef JRELINEEDIT_H
 #define JRELINEEDIT_H
+
 #include <QLineEdit>
-#include <QMessageBox>
 #include <QMouseEvent>
+#include <QPointer>
 #include "../SpeedAdjPage.h"
 
 class JReLineEdit : public QLineEdit
@@ -26,11 +27,24 @@ public:
     /**更新值
      */
     void upDataValLine(const ST_DEF_VAL _val);
+
+    /**修改控件值
+     */
+    void CheckVal();
+
+    /**速度修改窗口
+     */
+    void CreateSpeedAdjPage();
+private slots:
+    void GetCloseWndSlots(int nVal);
+
 protected:
     void mousePressEvent(QMouseEvent* event) override;
 
 private:
     ST_DEF_VAL      m_stSavedefVal;
+
+    QPointer<SpeedAdjPage> m_pSpeedWnd;
 };
 
 #endif // JRELINEEDIT_H

+ 153 - 7
View/die-bonder-ui/Src/RewriteControl/LightJoystickSwitchPage.cpp

@@ -2,6 +2,7 @@
 #include "ui_LightJoystickSwitchPage.h"
 #include "../common/JMessageTip.h"
 #include "../common/JQCommon.h"
+#include <QHash>
 
 LightJoystickSwitchPage::LightJoystickSwitchPage(QWidget *parent)
     : QWidget(parent)
@@ -24,7 +25,7 @@ void LightJoystickSwitchPage::InitForm()
     InitLineEdits();
     SliderBind();
 
-    JQCommon::SetQLineEditLimit(ui->valLineEdit);
+   // JQCommon::SetQLineEditLimit(ui->valLineEdit);
 }
 
 
@@ -59,6 +60,71 @@ void LightJoystickSwitchPage::InitLineEdits()
     }
 }
 
+void LightJoystickSwitchPage::MoveModule(const QString strAxis, const QString pos)
+{
+    if (m_pCameraBind)
+    {
+        // 目前没有测试多轴,多轴在用
+        std::vector<ns_module::MODULE_COORD_MOVE> vecPos;
+        vecPos.push_back({ strAxis.toStdString() ,pos.toDouble() });
+        m_pCameraBind->JModuleMove(ui->modeComboBox->currentText().toStdString(), vecPos, false);
+    }
+}
+
+void LightJoystickSwitchPage::DisableLayoutWidgets(QLayout* layout, bool isShow /*= false*/)
+{
+    for (int i = 0; i < layout->count(); ++i) 
+    {
+        QLayoutItem* item = layout->itemAt(i);
+        if (item->widget()) 
+        {
+            item->widget()->setEnabled(isShow);
+        }
+        else if (item->layout()) 
+        {
+            DisableLayoutWidgets(item->layout());
+        }
+    }
+}
+
+template<class T>
+void LightJoystickSwitchPage::DeduplicationBox(QComboBox* pCom, const T& veTemp, int nIndex)
+{
+    for (auto& a : veTemp)
+    {
+        QString strName;
+        if (nIndex == 0)
+        {
+            strName = a->GetModuleType().c_str();
+        }
+        else if (nIndex == 1)
+        {
+            strName = a->GetStringAxisType().c_str();
+        }
+
+        QStringList items;
+        for (int i = 0; i < pCom->count(); ++i)
+        {
+            items << pCom->itemText(i);
+        }
+
+        bool bMa = false; // 是否匹配
+        for (auto b : items)
+        {
+            if (b == strName)
+            {
+                bMa = true;
+                break;
+            }
+        }
+
+        if (!bMa)
+        {
+            pCom->addItem(strName);
+        }
+    }
+}
+
 void LightJoystickSwitchPage::BondSliderAndLineEdit(QSlider* slider, QLineEdit* lineEdit)
 {
     QIntValidator* validator = new QIntValidator(slider->minimum(), slider->maximum(), lineEdit);
@@ -182,6 +248,10 @@ void LightJoystickSwitchPage::InitMainCameraBind(CameraBind* pCameraBind, bool b
     {
         UpdataLightVal();
     }
+    if (m_pCameraBind)
+    {
+        DeduplicationBox(ui->modeComboBox, m_pCameraBind->m_vecCAxis, 0);
+    }
 }
 
 void LightJoystickSwitchPage::UpdatemPageGroup(Group* pGroup)
@@ -264,7 +334,7 @@ void LightJoystickSwitchPage::RealTimeUpdatesToU()
 {
     if (m_pCameraBind)
     {
-        ui->JTabShowLableLoop->setText(CombiningStr(true));
+       // ui->JTabShowLableLoop->setText(CombiningStr(true));
     }
 }
 
@@ -302,7 +372,7 @@ void LightJoystickSwitchPage::MoveJoystick()
 void LightJoystickSwitchPage::RunMoveOrMoveTo(bool isMoveTo)
 {
     QString strErrInfo = {};
-    QString strNum = ui->valLineEdit->text().trimmed();
+    QString strNum = "1";//ui->valLineEdit->text().trimmed();
     if (strNum.isEmpty())
     {
         strErrInfo = tr("please input value","请输入值");
@@ -413,9 +483,85 @@ void LightJoystickSwitchPage::resizeSingleUI() {
     ui->right_Button->setGeometry(QRect(90, 40, 41, 31));
     ui->up_Button->setGeometry(QRect(50, 10, 41, 31));
     ui->down_Button->setGeometry(QRect(50, 70, 41, 31));
-    ui->move_Button->setGeometry(QRect(170, 130, 60, 23));
-    ui->JTabShowLableLoop->setGeometry(QRect(10, 50, 200, 41));
-    ui->moveTo_Button->setGeometry(QRect(170, 170, 60, 23));
-    ui->valLineEdit->setGeometry(QRect(160, 100, 71, 21));
+    //ui->move_Button->setGeometry(QRect(170, 130, 60, 23));
+    //ui->JTabShowLableLoop->setGeometry(QRect(10, 50, 200, 41));
+    //ui->moveTo_Button->setGeometry(QRect(170, 170, 60, 23));
+    //ui->valLineEdit->setGeometry(QRect(160, 100, 71, 21));
+}
+
+
+void LightJoystickSwitchPage::on_xLineEdit_textChanged(const QString &arg1)
+{
+    MoveModule("X", arg1);
+}
+
+
+void LightJoystickSwitchPage::on_yLineEdit_textChanged(const QString &arg1)
+{
+    MoveModule("Y", arg1);
+}
+
+
+void LightJoystickSwitchPage::on_zLineEdit_textChanged(const QString &arg1)
+{
+    MoveModule("Z", arg1);
+}
+
+
+void LightJoystickSwitchPage::on_rLineEdit_textChanged(const QString &arg1)
+{
+    MoveModule("R", arg1);
+}
+
+
+void LightJoystickSwitchPage::on_forceLineEdit_textChanged(const QString &arg1)
+{
+    MoveModule("FORCE", arg1);
+}
+
+void LightJoystickSwitchPage::on_modeComboBox_currentIndexChanged(int index)
+{
+    QString strMod = ui->modeComboBox->itemText(index);
+    // 先禁用所有相关布局
+    const QList<QLayout*> allLayouts = {
+        ui->forceLayout,
+        ui->xLayout,
+        ui->yLayout,
+        ui->rLayout,
+        ui->zLayout,
+    };
+    for (auto* layout : allLayouts) 
+    {
+        DisableLayoutWidgets(layout, false);
+    }
+
+    // 收集当前模块支持的轴类型
+    QSet<QString> supportedAxes;
+    for (const auto& axis : m_pCameraBind->m_vecCAxis) 
+    {
+        if (strMod == axis->GetModuleType().c_str())
+        {
+            supportedAxes.insert(axis->GetStringAxisType().c_str());
+        }
+    }
+
+    // 根据支持的轴启用对应布局
+    const QHash<QString, QLayout*> axisToLayout = {
+        {"FORCE", ui->forceLayout},
+        {"X", ui->xLayout},
+        {"Y", ui->yLayout},
+        {"R", ui->rLayout},
+        {"Z", ui->zLayout},
+        {"Z1", ui->zLayout}
+    };
+
+
+    for (auto it = axisToLayout.constBegin(); it != axisToLayout.constEnd(); ++it) 
+    {
+        if (supportedAxes.contains(it.key())) 
+        {
+            DisableLayoutWidgets(it.value(), true);
+        }
+    }   
 }
 

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

@@ -57,9 +57,23 @@ public:
     /**设置移动摇杆信息
     */
     void SetMoveJoystickInfo(const ST_MOVE_AXIS& movInfo);
+
 protected:
     void timerEvent(QTimerEvent* event) override;
 
+private slots:
+    void on_xLineEdit_textChanged(const QString &arg1);
+
+    void on_yLineEdit_textChanged(const QString &arg1);
+
+    void on_zLineEdit_textChanged(const QString &arg1);
+
+    void on_rLineEdit_textChanged(const QString &arg1);
+
+    void on_forceLineEdit_textChanged(const QString &arg1);
+
+    void on_modeComboBox_currentIndexChanged(int index);
+
 private:
     /**组合字符串
      */
@@ -96,14 +110,23 @@ private:
     void SliderBind();
 
     void InitLineEdits();
+
+    /**移动轴
+     */
+    void MoveModule(const QString strAxis, const QString pos);
+
+    void DisableLayoutWidgets(QLayout* layout, bool isShow = false);
+
+
+    template<class T>
+    void DeduplicationBox(QComboBox* pCom, const T& veTemp, int nIndex);
 private:
     Ui::LightJoystickSwitchPage *ui;
 
 
     /**硬件指针
      */
-    QPointer<CameraBind> m_pCameraBind;
-    
+    QPointer<CameraBind> m_pCameraBind; // 用这个是因为需要测试
 
     /**当前页面的Group
     */

+ 265 - 158
View/die-bonder-ui/Src/RewriteControl/LightJoystickSwitchPage.ui

@@ -412,10 +412,10 @@
      <widget class="JoystickPage" name="widgetPage" native="true">
       <property name="geometry">
        <rect>
-        <x>0</x>
-        <y>-10</y>
-        <width>141</width>
-        <height>91</height>
+        <x>20</x>
+        <y>0</y>
+        <width>131</width>
+        <height>121</height>
        </rect>
       </property>
      </widget>
@@ -435,12 +435,18 @@
      <widget class="QLabel" name="label">
       <property name="geometry">
        <rect>
-        <x>20</x>
+        <x>10</x>
         <y>10</y>
-        <width>61</width>
-        <height>21</height>
+        <width>71</width>
+        <height>31</height>
        </rect>
       </property>
+      <property name="font">
+       <font>
+        <family>宋体</family>
+        <pointsize>12</pointsize>
+       </font>
+      </property>
       <property name="text">
        <string>module:</string>
       </property>
@@ -451,195 +457,296 @@
      <widget class="QComboBox" name="modeComboBox">
       <property name="geometry">
        <rect>
-        <x>100</x>
+        <x>90</x>
         <y>10</y>
-        <width>71</width>
-        <height>21</height>
-       </rect>
-      </property>
-     </widget>
-     <widget class="QLabel" name="JTabShowLableLoop">
-      <property name="geometry">
-       <rect>
-        <x>10</x>
-        <y>80</y>
-        <width>231</width>
+        <width>91</width>
         <height>31</height>
        </rect>
       </property>
       <property name="font">
        <font>
-        <family>Agency FB</family>
+        <family>宋体</family>
         <pointsize>12</pointsize>
        </font>
       </property>
-      <property name="text">
-       <string>pos:</string>
-      </property>
-      <property name="alignment">
-       <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
-      </property>
      </widget>
-     <widget class="QPushButton" name="moveTo_Button">
+     <widget class="QWidget" name="layoutWidget">
       <property name="geometry">
        <rect>
-        <x>90</x>
-        <y>50</y>
-        <width>71</width>
-        <height>23</height>
+        <x>190</x>
+        <y>90</y>
+        <width>141</width>
+        <height>33</height>
        </rect>
       </property>
-      <property name="minimumSize">
-       <size>
-        <width>42</width>
-        <height>0</height>
-       </size>
-      </property>
-      <property name="text">
-       <string>MoveTo</string>
-      </property>
+      <layout class="QHBoxLayout" name="forceLayout">
+       <property name="spacing">
+        <number>0</number>
+       </property>
+       <item>
+        <widget class="QCheckBox" name="forceCheckBox">
+         <property name="minimumSize">
+          <size>
+           <width>67</width>
+           <height>30</height>
+          </size>
+         </property>
+         <property name="font">
+          <font>
+           <family>宋体</family>
+           <pointsize>12</pointsize>
+          </font>
+         </property>
+         <property name="text">
+          <string>FORCE</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="JReLineEdit" name="forceLineEdit">
+         <property name="minimumSize">
+          <size>
+           <width>0</width>
+           <height>30</height>
+          </size>
+         </property>
+         <property name="font">
+          <font>
+           <family>宋体</family>
+           <pointsize>12</pointsize>
+          </font>
+         </property>
+         <property name="text">
+          <string>0</string>
+         </property>
+         <property name="alignment">
+          <set>Qt::AlignCenter</set>
+         </property>
+        </widget>
+       </item>
+      </layout>
      </widget>
-     <widget class="QLineEdit" name="valLineEdit">
+     <widget class="QWidget" name="layoutWidget">
       <property name="geometry">
        <rect>
         <x>10</x>
         <y>50</y>
-        <width>71</width>
-        <height>21</height>
+        <width>161</width>
+        <height>32</height>
        </rect>
       </property>
+      <layout class="QHBoxLayout" name="xLayout">
+       <property name="spacing">
+        <number>0</number>
+       </property>
+       <item>
+        <widget class="QCheckBox" name="xCheckBox">
+         <property name="minimumSize">
+          <size>
+           <width>56</width>
+           <height>30</height>
+          </size>
+         </property>
+         <property name="font">
+          <font>
+           <family>宋体</family>
+           <pointsize>12</pointsize>
+          </font>
+         </property>
+         <property name="text">
+          <string>X</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="JReLineEdit" name="xLineEdit">
+         <property name="minimumSize">
+          <size>
+           <width>0</width>
+           <height>30</height>
+          </size>
+         </property>
+         <property name="font">
+          <font>
+           <family>宋体</family>
+           <pointsize>12</pointsize>
+          </font>
+         </property>
+         <property name="text">
+          <string>0</string>
+         </property>
+         <property name="alignment">
+          <set>Qt::AlignCenter</set>
+         </property>
+        </widget>
+       </item>
+      </layout>
      </widget>
-     <widget class="QPushButton" name="move_Button">
+     <widget class="QWidget" name="layoutWidget">
       <property name="geometry">
        <rect>
-        <x>90</x>
-        <y>80</y>
-        <width>71</width>
-        <height>23</height>
+        <x>10</x>
+        <y>90</y>
+        <width>161</width>
+        <height>32</height>
        </rect>
       </property>
-      <property name="minimumSize">
-       <size>
-        <width>42</width>
-        <height>0</height>
-       </size>
-      </property>
-      <property name="text">
-       <string>Move</string>
-      </property>
+      <layout class="QHBoxLayout" name="yLayout">
+       <property name="spacing">
+        <number>0</number>
+       </property>
+       <item>
+        <widget class="QCheckBox" name="yCheckBox">
+         <property name="minimumSize">
+          <size>
+           <width>56</width>
+           <height>30</height>
+          </size>
+         </property>
+         <property name="font">
+          <font>
+           <family>宋体</family>
+           <pointsize>12</pointsize>
+          </font>
+         </property>
+         <property name="text">
+          <string>Y</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="JReLineEdit" name="yLineEdit">
+         <property name="minimumSize">
+          <size>
+           <width>0</width>
+           <height>30</height>
+          </size>
+         </property>
+         <property name="font">
+          <font>
+           <family>宋体</family>
+           <pointsize>12</pointsize>
+          </font>
+         </property>
+         <property name="text">
+          <string>0</string>
+         </property>
+         <property name="alignment">
+          <set>Qt::AlignCenter</set>
+         </property>
+        </widget>
+       </item>
+      </layout>
      </widget>
-     <widget class="QGroupBox" name="axisGroupBox">
+     <widget class="QWidget" name="layoutWidget">
       <property name="geometry">
        <rect>
-        <x>180</x>
-        <y>-10</y>
-        <width>161</width>
-        <height>151</height>
+        <x>190</x>
+        <y>10</y>
+        <width>141</width>
+        <height>32</height>
        </rect>
       </property>
-      <property name="title">
-       <string/>
-      </property>
-      <layout class="QVBoxLayout" name="verticalLayout">
-       <item>
-        <layout class="QHBoxLayout" name="forceLayout">
-         <item>
-          <widget class="QCheckBox" name="forceCheckBox">
-           <property name="minimumSize">
-            <size>
-             <width>56</width>
-             <height>0</height>
-            </size>
-           </property>
-           <property name="text">
-            <string>FORCE</string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <widget class="JReLineEdit" name="forceLineEdit"/>
-         </item>
-        </layout>
-       </item>
+      <layout class="QHBoxLayout" name="zLayout">
+       <property name="spacing">
+        <number>0</number>
+       </property>
        <item>
-        <layout class="QHBoxLayout" name="xLayout">
-         <item>
-          <widget class="QCheckBox" name="xCheckBox">
-           <property name="minimumSize">
-            <size>
-             <width>56</width>
-             <height>0</height>
-            </size>
-           </property>
-           <property name="text">
-            <string>X</string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <widget class="JReLineEdit" name="xLineEdit"/>
-         </item>
-        </layout>
+        <widget class="QCheckBox" name="zCheckBox">
+         <property name="minimumSize">
+          <size>
+           <width>56</width>
+           <height>30</height>
+          </size>
+         </property>
+         <property name="font">
+          <font>
+           <family>宋体</family>
+           <pointsize>12</pointsize>
+          </font>
+         </property>
+         <property name="text">
+          <string>z</string>
+         </property>
+        </widget>
        </item>
        <item>
-        <layout class="QHBoxLayout" name="yLayout">
-         <item>
-          <widget class="QCheckBox" name="yCheckBox">
-           <property name="minimumSize">
-            <size>
-             <width>56</width>
-             <height>0</height>
-            </size>
-           </property>
-           <property name="text">
-            <string>y</string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <widget class="JReLineEdit" name="yLineEdit"/>
-         </item>
-        </layout>
+        <widget class="JReLineEdit" name="zLineEdit">
+         <property name="minimumSize">
+          <size>
+           <width>0</width>
+           <height>30</height>
+          </size>
+         </property>
+         <property name="font">
+          <font>
+           <family>宋体</family>
+           <pointsize>12</pointsize>
+          </font>
+         </property>
+         <property name="text">
+          <string>0</string>
+         </property>
+         <property name="alignment">
+          <set>Qt::AlignCenter</set>
+         </property>
+        </widget>
        </item>
+      </layout>
+     </widget>
+     <widget class="QWidget" name="layoutWidget">
+      <property name="geometry">
+       <rect>
+        <x>190</x>
+        <y>50</y>
+        <width>141</width>
+        <height>32</height>
+       </rect>
+      </property>
+      <layout class="QHBoxLayout" name="rLayout">
+       <property name="spacing">
+        <number>0</number>
+       </property>
        <item>
-        <layout class="QHBoxLayout" name="zLayout">
-         <item>
-          <widget class="QCheckBox" name="zCheckBox">
-           <property name="minimumSize">
-            <size>
-             <width>56</width>
-             <height>0</height>
-            </size>
-           </property>
-           <property name="text">
-            <string>z</string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <widget class="JReLineEdit" name="zLineEdit"/>
-         </item>
-        </layout>
+        <widget class="QCheckBox" name="rCheckBox">
+         <property name="minimumSize">
+          <size>
+           <width>56</width>
+           <height>30</height>
+          </size>
+         </property>
+         <property name="font">
+          <font>
+           <family>宋体</family>
+           <pointsize>12</pointsize>
+          </font>
+         </property>
+         <property name="text">
+          <string>R</string>
+         </property>
+        </widget>
        </item>
        <item>
-        <layout class="QHBoxLayout" name="rLayout">
-         <item>
-          <widget class="QCheckBox" name="rCheckBox">
-           <property name="minimumSize">
-            <size>
-             <width>56</width>
-             <height>0</height>
-            </size>
-           </property>
-           <property name="text">
-            <string>R</string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <widget class="JReLineEdit" name="rLineEdit"/>
-         </item>
-        </layout>
+        <widget class="JReLineEdit" name="rLineEdit">
+         <property name="minimumSize">
+          <size>
+           <width>0</width>
+           <height>30</height>
+          </size>
+         </property>
+         <property name="font">
+          <font>
+           <family>宋体</family>
+           <pointsize>12</pointsize>
+          </font>
+         </property>
+         <property name="text">
+          <string>0</string>
+         </property>
+         <property name="alignment">
+          <set>Qt::AlignCenter</set>
+         </property>
+        </widget>
        </item>
       </layout>
      </widget>

+ 109 - 5
View/die-bonder-ui/Src/RewriteControl/SpeedAdjPage.cpp

@@ -1,15 +1,22 @@
 #include "SpeedAdjPage.h"
 #include "ui_SpeedAdjPage.h"
+#include <QMouseEvent>
+#include <QRegularExpression>
+#include <QPropertyAnimation>
+#include <QScreen>
 
 SpeedAdjPage::SpeedAdjPage(QWidget *parent)
     : QMainWindow(parent)
     , ui(new Ui::SpeedAdjPage)
 {
     ui->setupUi(this);
+
+    Init();
 }
 
 SpeedAdjPage::~SpeedAdjPage()
 {
+    qApp->removeEventFilter(this);
     delete ui;
 }
 
@@ -19,16 +26,113 @@ void SpeedAdjPage::updateDefVal(const ST_DEF_VAL& val)
     strTip += val.strMode;
     strTip += tr("Axis:(","轴:(");
 
-    for (int i = 0; i < val.listStrAxis.size(); i++)
+    for (auto&a: val.vecPos)
     {
-        strTip += ","; // 组成(x,y,z)
-        strTip += val.listStrAxis[i];
+        strTip += a.AxisType.c_str();
         strTip += ":";
-        QString s = QString::number(val.listDoVal[i], 'f', 2);
+        QString s = QString::number(a.pos, 'f', 2);
     }
     strTip += ")";
 
+    //ui->speedTitleLabel->setText(strTip);
+
+}
+
+void SpeedAdjPage::Init()
+{
+    qApp->installEventFilter(this);
+    setWindowFlag(Qt::FramelessWindowHint);
+    //setFocusPolicy(Qt::StrongFocus);
+
+    // 绑定按钮
+
+    QList<QPushButton*> listPBut;
+    listPBut.push_back(ui->subBut_1);
+    listPBut.push_back(ui->addBut_1);
+
+    listPBut.push_back(ui->subBut_10);
+    listPBut.push_back(ui->addBut_10);
+
+    listPBut.push_back(ui->subBut_100);
+    listPBut.push_back(ui->addBut_100);
+
+    listPBut.push_back(ui->subBut_1000);
+    listPBut.push_back(ui->addBut_1000);
 
-    ui->speedTitleLabel->setText(strTip);
+    listPBut.push_back(ui->subBut_10000);
+    listPBut.push_back(ui->addBut_10000);
+
+    listPBut.push_back(ui->subBut_100000);
+    listPBut.push_back(ui->addBut_100000);
+
+    // 连接每个按钮的clicked信号
+    for (QPushButton* pBut : listPBut)
+    {
+        connect(pBut, &QPushButton::clicked, [this, pBut]() 
+        {
+                QRegularExpression re("^(sub|add)But_(\\d+)$");
+                QRegularExpressionMatch match = re.match(pBut->objectName());
+                if (match.hasMatch()) 
+                {
+                    QString prefix = match.captured(1);
+                    int num = match.captured(2).toInt();
+                    int value = (prefix == "sub") ? -num : num;
+                    m_nVal = value; // 更新成员变量
+                    emit CloseWnd(m_nVal);
+                }
+        });
+    }
+}
+
+void SpeedAdjPage::mousePressEvent(QMouseEvent* event)
+{    
+    if (event->button() == Qt::LeftButton)
+    {
+        m_mousePressPosition = event->globalPos();
+        m_windowPosition = this->frameGeometry().topLeft();
+    }
+}
 
+void SpeedAdjPage::mouseMoveEvent(QMouseEvent* event)
+{
+    if (event->buttons() & Qt::LeftButton)
+    {
+        QPoint delta = event->globalPos() - m_mousePressPosition;
+        this->move(m_windowPosition + delta);
+    }
+}
+
+bool SpeedAdjPage::eventFilter(QObject* obj, QEvent* event)
+{
+    if (event->type() == QEvent::MouseButtonPress) 
+    {
+        QMouseEvent* mouseEvent = static_cast<QMouseEvent*>(event);
+        QPoint globalPos = mouseEvent->globalPos();
+        QRect dialogFrame = this->frameGeometry();
+        if (this->isVisible() && !dialogFrame.contains(globalPos)) 
+        {
+            this->close();
+        }
+    }
+    return false;
+}
+
+void SpeedAdjPage::changeEvent(QEvent* event)
+{
+    if (event->type() == QEvent::WindowActivate)
+    {
+        // 窗口被激活
+        //qDebug() << "Main window is now active";
+    }
+    else if (event->type() == QEvent::WindowDeactivate) 
+    {
+        // 窗口失去激活
+        //qDebug() << "Main window is no longer active";
+    }
+    QMainWindow::changeEvent(event);
+}
+
+void SpeedAdjPage::on_closeBut_clicked()
+{
+    this->close();
 }

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

@@ -2,12 +2,13 @@
 #define SPEEDADJPAGE_H
 
 #include <QMainWindow>
+#include <CViewInterface.h>
+#include <QTimer>
 
 struct ST_DEF_VAL
 {
     QString         strMode; 
-    QList<double>   listDoVal;    //存在多组
-    QList<QString>  listStrAxis; // 存在多组
+    std::vector<ns_module::MODULE_COORD_MOVE> vecPos;
 };
 
 namespace Ui {
@@ -25,8 +26,35 @@ public:
     /**更新默认值
      */
     void updateDefVal(const ST_DEF_VAL& val);
+private:
+    void Init();
+   
+signals:
+    /**窗口关闭要返回值
+     */
+    void CloseWnd(int nVal);
+
+protected:
+    void mousePressEvent(QMouseEvent* event) override;
+    void mouseMoveEvent(QMouseEvent* event) override;
+
+    bool eventFilter(QObject* obj, QEvent* event) override;
+
+    void changeEvent(QEvent* event) override;
+
+private slots:
+    void on_closeBut_clicked();
+
 private:
     Ui::SpeedAdjPage *ui;
+
+private:
+    int     m_nVal = 1;
+
+    bool    m_isInit = true;
+
+    QPoint m_mousePressPosition;
+    QPoint m_windowPosition;
 };
 
 #endif // SPEEDADJPAGE_H

+ 231 - 27
View/die-bonder-ui/Src/RewriteControl/SpeedAdjPage.ui

@@ -6,60 +6,264 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>467</width>
-    <height>346</height>
+    <width>564</width>
+    <height>180</height>
    </rect>
   </property>
   <property name="windowTitle">
    <string>MainWindow</string>
   </property>
   <widget class="QWidget" name="centralwidget">
+   <widget class="QLabel" name="speedLabel">
+    <property name="geometry">
+     <rect>
+      <x>0</x>
+      <y>0</y>
+      <width>561</width>
+      <height>31</height>
+     </rect>
+    </property>
+    <property name="styleSheet">
+     <string notr="true">background-color: rgb(170, 170, 255);</string>
+    </property>
+    <property name="text">
+     <string extracomment="快捷键盘">Shortcut Keyboard</string>
+    </property>
+   </widget>
    <widget class="QWidget" name="gridLayoutWidget">
     <property name="geometry">
      <rect>
-      <x>10</x>
-      <y>10</y>
-      <width>451</width>
-      <height>331</height>
+      <x>0</x>
+      <y>30</y>
+      <width>561</width>
+      <height>101</height>
      </rect>
     </property>
     <layout class="QGridLayout" name="gridLayout">
      <property name="spacing">
       <number>0</number>
      </property>
-     <item row="1" column="0" colspan="3">
-      <widget class="SpeedAdjWnd" name="speed1" native="true"/>
+     <item row="1" column="0">
+      <widget class="QPushButton" name="subBut_10000">
+       <property name="minimumSize">
+        <size>
+         <width>80</width>
+         <height>40</height>
+        </size>
+       </property>
+       <property name="text">
+        <string>-10000</string>
+       </property>
+      </widget>
+     </item>
+     <item row="2" column="1">
+      <widget class="QPushButton" name="subBut_1000">
+       <property name="minimumSize">
+        <size>
+         <width>80</width>
+         <height>40</height>
+        </size>
+       </property>
+       <property name="text">
+        <string>-1000</string>
+       </property>
+      </widget>
+     </item>
+     <item row="2" column="3">
+      <widget class="QPushButton" name="addBut_10">
+       <property name="minimumSize">
+        <size>
+         <width>80</width>
+         <height>40</height>
+        </size>
+       </property>
+       <property name="text">
+        <string>+10</string>
+       </property>
+      </widget>
+     </item>
+     <item row="1" column="4">
+      <widget class="QPushButton" name="addBut_100">
+       <property name="minimumSize">
+        <size>
+         <width>80</width>
+         <height>40</height>
+        </size>
+       </property>
+       <property name="text">
+        <string>+100</string>
+       </property>
+      </widget>
+     </item>
+     <item row="2" column="0">
+      <widget class="QPushButton" name="subBut_100000">
+       <property name="minimumSize">
+        <size>
+         <width>80</width>
+         <height>40</height>
+        </size>
+       </property>
+       <property name="text">
+        <string>-100000</string>
+       </property>
+      </widget>
+     </item>
+     <item row="2" column="2">
+      <widget class="QPushButton" name="subBut_10">
+       <property name="minimumSize">
+        <size>
+         <width>80</width>
+         <height>40</height>
+        </size>
+       </property>
+       <property name="text">
+        <string>-10</string>
+       </property>
+      </widget>
+     </item>
+     <item row="2" column="4">
+      <widget class="QPushButton" name="addBut_1000">
+       <property name="minimumSize">
+        <size>
+         <width>80</width>
+         <height>40</height>
+        </size>
+       </property>
+       <property name="text">
+        <string>+1000</string>
+       </property>
+      </widget>
+     </item>
+     <item row="2" column="5">
+      <widget class="QPushButton" name="addBut_100000">
+       <property name="minimumSize">
+        <size>
+         <width>80</width>
+         <height>40</height>
+        </size>
+       </property>
+       <property name="text">
+        <string>+100000</string>
+       </property>
+      </widget>
+     </item>
+     <item row="1" column="5">
+      <widget class="QPushButton" name="addBut_10000">
+       <property name="minimumSize">
+        <size>
+         <width>80</width>
+         <height>40</height>
+        </size>
+       </property>
+       <property name="text">
+        <string>+10000</string>
+       </property>
+      </widget>
+     </item>
+     <item row="1" column="2">
+      <widget class="QPushButton" name="subBut_1">
+       <property name="minimumSize">
+        <size>
+         <width>80</width>
+         <height>40</height>
+        </size>
+       </property>
+       <property name="text">
+        <string>-1</string>
+       </property>
+      </widget>
+     </item>
+     <item row="1" column="1">
+      <widget class="QPushButton" name="subBut_100">
+       <property name="minimumSize">
+        <size>
+         <width>80</width>
+         <height>40</height>
+        </size>
+       </property>
+       <property name="text">
+        <string>-100</string>
+       </property>
+      </widget>
+     </item>
+     <item row="1" column="3">
+      <widget class="QPushButton" name="addBut_1">
+       <property name="minimumSize">
+        <size>
+         <width>80</width>
+         <height>40</height>
+        </size>
+       </property>
+       <property name="text">
+        <string>+1</string>
+       </property>
+      </widget>
      </item>
-     <item row="0" column="0" colspan="3">
-      <widget class="QLabel" name="speedTitleLabel">
-       <property name="font">
-        <font>
-         <pointsize>16</pointsize>
-        </font>
+    </layout>
+   </widget>
+   <widget class="QWidget" name="layoutWidget">
+    <property name="geometry">
+     <rect>
+      <x>110</x>
+      <y>140</y>
+      <width>351</width>
+      <height>32</height>
+     </rect>
+    </property>
+    <layout class="QHBoxLayout" name="horizontalLayout">
+     <item>
+      <widget class="QPushButton" name="subBut">
+       <property name="minimumSize">
+        <size>
+         <width>80</width>
+         <height>30</height>
+        </size>
        </property>
        <property name="text">
-        <string>当前速度:100000</string>
+        <string>&lt;&lt;</string>
        </property>
-       <property name="alignment">
-        <set>Qt::AlignCenter</set>
+      </widget>
+     </item>
+     <item>
+      <widget class="QLineEdit" name="valLineEdit">
+       <property name="minimumSize">
+        <size>
+         <width>80</width>
+         <height>30</height>
+        </size>
        </property>
       </widget>
      </item>
-     <item row="2" column="0" colspan="3">
-      <widget class="SpeedAdjWnd" name="speed100" native="true"/>
+     <item>
+      <widget class="QPushButton" name="addBut">
+       <property name="minimumSize">
+        <size>
+         <width>80</width>
+         <height>30</height>
+        </size>
+       </property>
+       <property name="text">
+        <string>&gt;&gt;</string>
+       </property>
+      </widget>
      </item>
     </layout>
    </widget>
+   <widget class="QPushButton" name="closeBut">
+    <property name="geometry">
+     <rect>
+      <x>527</x>
+      <y>2</y>
+      <width>31</width>
+      <height>23</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>X</string>
+    </property>
+   </widget>
   </widget>
  </widget>
- <customwidgets>
-  <customwidget>
-   <class>SpeedAdjWnd</class>
-   <extends>QWidget</extends>
-   <header>SpeedAdjWnd.h</header>
-   <container>1</container>
-  </customwidget>
- </customwidgets>
  <resources/>
  <connections/>
 </ui>

+ 6 - 1
View/die-bonder-ui/Src/RewriteControl/SpeedAdjWnd.cpp

@@ -2,7 +2,7 @@
 #include "ui_SpeedAdjWnd.h"
 
 SpeedAdjWnd::SpeedAdjWnd(QWidget *parent)
-    : QMainWindow(parent)
+    : QWidget(parent)
     , ui(new Ui::SpeedAdjWnd)
 {
     ui->setupUi(this);
@@ -12,3 +12,8 @@ SpeedAdjWnd::~SpeedAdjWnd()
 {
     delete ui;
 }
+
+void SpeedAdjWnd::SetSpeedVal(int nVal)
+{
+    ui->speedLabel->setText(QString::number(nVal));
+}

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

@@ -1,13 +1,13 @@
 #ifndef SPEEDADJWND_H
 #define SPEEDADJWND_H
 
-#include <QMainWindow>
+#include <QWidget>
 
 namespace Ui {
 class SpeedAdjWnd;
 }
 
-class SpeedAdjWnd : public QMainWindow
+class SpeedAdjWnd : public QWidget
 {
     Q_OBJECT
 
@@ -15,6 +15,7 @@ public:
     explicit SpeedAdjWnd(QWidget *parent = nullptr);
     ~SpeedAdjWnd();
 
+    void SetSpeedVal(int nVal);
 private:
     Ui::SpeedAdjWnd *ui;
 };

+ 58 - 12
View/die-bonder-ui/Src/RewriteControl/SpeedAdjWnd.ui

@@ -1,34 +1,61 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <ui version="4.0">
  <class>SpeedAdjWnd</class>
- <widget class="QMainWindow" name="SpeedAdjWnd">
+ <widget class="QWidget" name="SpeedAdjWnd">
   <property name="geometry">
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>429</width>
-    <height>51</height>
+    <width>510</width>
+    <height>68</height>
    </rect>
   </property>
   <property name="windowTitle">
    <string>MainWindow</string>
   </property>
-  <widget class="QWidget" name="centralwidget">
-   <widget class="QWidget" name="">
+  <widget class="QWidget" name="centralwidget" native="true">
+   <property name="geometry">
+    <rect>
+     <x>0</x>
+     <y>0</y>
+     <width>509</width>
+     <height>108</height>
+    </rect>
+   </property>
+   <widget class="QWidget" name="layoutWidget">
     <property name="geometry">
      <rect>
       <x>1</x>
       <y>10</y>
-      <width>421</width>
-      <height>37</height>
+      <width>508</width>
+      <height>51</height>
      </rect>
     </property>
     <layout class="QHBoxLayout" name="horizontalLayout">
+     <property name="spacing">
+      <number>3</number>
+     </property>
      <item>
-      <widget class="QLabel" name="speedLabel_1">
+      <spacer name="horizontalSpacer_2">
+       <property name="orientation">
+        <enum>Qt::Horizontal</enum>
+       </property>
+       <property name="sizeType">
+        <enum>QSizePolicy::Fixed</enum>
+       </property>
+       <property name="sizeHint" stdset="0">
+        <size>
+         <width>30</width>
+         <height>20</height>
+        </size>
+       </property>
+      </spacer>
+     </item>
+     <item>
+      <widget class="QLabel" name="speedLabel">
        <property name="minimumSize">
         <size>
-         <width>88</width>
+         <width>113</width>
          <height>0</height>
         </size>
        </property>
@@ -46,7 +73,7 @@
       </widget>
      </item>
      <item>
-      <widget class="QPushButton" name="speedSubBut_1">
+      <widget class="QPushButton" name="speedSubBut">
        <property name="font">
         <font>
          <pointsize>16</pointsize>
@@ -58,16 +85,19 @@
       </widget>
      </item>
      <item>
-      <widget class="QLineEdit" name="lineEdit">
+      <widget class="QLineEdit" name="speedLineEdit">
        <property name="font">
         <font>
          <pointsize>16</pointsize>
         </font>
        </property>
+       <property name="alignment">
+        <set>Qt::AlignCenter</set>
+       </property>
       </widget>
      </item>
      <item>
-      <widget class="QPushButton" name="speedAddBut_1">
+      <widget class="QPushButton" name="speedAddBut">
        <property name="font">
         <font>
          <pointsize>16</pointsize>
@@ -78,6 +108,22 @@
        </property>
       </widget>
      </item>
+     <item>
+      <spacer name="horizontalSpacer">
+       <property name="orientation">
+        <enum>Qt::Horizontal</enum>
+       </property>
+       <property name="sizeType">
+        <enum>QSizePolicy::Fixed</enum>
+       </property>
+       <property name="sizeHint" stdset="0">
+        <size>
+         <width>89</width>
+         <height>20</height>
+        </size>
+       </property>
+      </spacer>
+     </item>
     </layout>
    </widget>
   </widget>