Kaynağa Gözat

值获取不到

JonYang 1 gün önce
ebeveyn
işleme
0033e73993

+ 1 - 1
View/die-bonder-ui/OriginalWnd/DbTreeViewManager.cpp

@@ -3064,7 +3064,7 @@ void DbTreeViewManager::displayThirdLevelFields(const QList<ST_TABLE_CONTROL_DAT
                                     strAxisType.toStdString(), strNum);
                             }
 
-                            comboInput->text() = strNum;
+                            comboInput->setText(QString::number(strNum, 'f', 2));
                             //QPushButton* senderBtn = qobject_cast<QPushButton*>(sender());
                             //if (senderBtn) {
                             //    QString strOnclick = senderBtn->property("Get").toString();

+ 4 - 6
View/die-bonder-ui/Src/CameraBind.cpp

@@ -69,11 +69,11 @@ void CameraBind::InitAllCamera()
 
 }
 
-void CameraBind::SetModuleMove(const std::string& strModuleType, const std::string& enAxisType, double pos, bool bMoveTo)
+long CameraBind::SetModuleMove(const std::string& strModuleType, const std::string& enAxisType, double pos, bool bMoveTo)
 {
     if (m_pCViewInterface == nullptr)
     {
-        return;
+        return -1;
     }
 
     for (auto& a : m_vecCAxis)
@@ -82,14 +82,12 @@ void CameraBind::SetModuleMove(const std::string& strModuleType, const std::stri
         {
             if (bMoveTo)
             {
-                m_pCViewInterface->GetViewMotion()->ModuleMoveTo(strModuleType, enAxisType, pos);
+                return m_pCViewInterface->GetViewMotion()->ModuleMoveTo(strModuleType, enAxisType, pos);
             }
             else
             {
-                m_pCViewInterface->GetViewMotion()->ModuleMove(strModuleType, enAxisType, pos);
+                return  m_pCViewInterface->GetViewMotion()->ModuleMove(strModuleType, enAxisType, pos);
             }
-            
-            return;
         }
     }
 }

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

@@ -61,7 +61,7 @@ public:
 
     /**ÒÆ¶¯Öá
      */
-    void SetModuleMove(const std::string& strModuleType, const std::string& enAxisType, double pos, bool bMoveTo);
+    long 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);
 
     /**»ØÁã

+ 69 - 4
View/die-bonder-ui/Src/RewriteControl/LightJoystickSwitchPage.cpp

@@ -126,15 +126,80 @@ void LightJoystickSwitchPage::MoveModule(const QString strAxis, const QString po
                     {
                         if (lineEdit->m_isSetVal)
                         {
-                            // 目前没有测试多轴,多轴在用
-                            std::vector<ns_module::MODULE_COORD_MOVE> vecPos;
-                            vecPos.push_back({ strAxis.toStdString() ,pos.toDouble() });
-                            m_pCameraBind->JModuleMove(ui->modeComboBox->currentText().toStdString(), vecPos, false);
+                            std::thread run([&, strAxis, pos]()
+                                {
+                                
+                                // 目前没有测试多轴,多轴在用
+                                std::vector<ns_module::MODULE_COORD_MOVE> vecPos;
+                                vecPos.push_back({ strAxis.toStdString() ,pos.toDouble() });
+                                m_pCameraBind->JModuleMove(ui->modeComboBox->currentText().toStdString(), vecPos, false);
+                                });
+                            run.detach();
+                           
                         }
                     }
                 }
             }
         }
+
+
+
+        //std::thread runFun([&, strAxis, pos]() {
+
+        //    auto LoopFun = [&](const QHash<QString, QLayout*> lay, bool isDisable)
+        //    {
+        //        for (auto it = lay.begin(); it != lay.end(); ++it)
+        //        {
+        //            const QString& key = it.key();
+        //            QLayout* layout = it.value();
+        //            DisableLayoutWidgets(layout, isDisable);
+        //        }
+        //    };
+
+        //    const QHash<QString, QLayout*> m_HaAxisToLayout = {
+        //    {"FORCE", ui->forceLayout},
+        //    {"X", ui->xLayout},
+        //    {"Y", ui->yLayout},
+        //    {"R", ui->rLayout},
+        //    {"Z", ui->zLayout},
+        //    {"Z1", ui->zLayout}
+        //    };
+        //    //LoopFun(m_HaAxisToLayout, false);
+
+
+
+        //    if (m_HaAxisToLayout.contains(strAxis))
+        //    {
+        //        QLayout* layout = m_HaAxisToLayout.value(strAxis);
+        //        for (int i = 0; i < layout->count(); ++i)
+        //        {
+        //            QWidget* widget = layout->itemAt(i)->widget();
+        //            if (widget && widget->inherits("QLineEdit"))
+        //            {
+        //                JReLineEdit* lineEdit = qobject_cast<JReLineEdit*>(widget);
+        //                if (lineEdit)
+        //                {
+        //                    if (lineEdit->m_isSetVal)
+        //                    {
+
+        //                        m_pCameraBind->SetModuleMove(
+        //                            ui->modeComboBox->currentText().toStdString(),
+        //                            strAxis.toStdString(),
+        //                            pos.toDouble(), false);
+
+
+        //                        //// 目前没有测试多轴,多轴在用 ,没有多轴的情况
+        //                        //std::vector<ns_module::MODULE_COORD_MOVE> vecPos;
+        //                        //vecPos.push_back({ strAxis.toStdString() ,pos.toDouble() });
+        //                        //m_pCameraBind->JModuleMove(ui->modeComboBox->currentText().toStdString(), vecPos, false);
+        //                    }
+        //                }
+        //            }
+        //        }
+        //    }
+
+        //    //LoopFun(m_HaAxisToLayout, true);
+        //    });
     }
 }