Browse Source

change tool/controller_torquebrake_get for set startup torque.

yuchuli 3 years ago
parent
commit
2ddd91b225

+ 6 - 0
src/tool/controller_torquebrake_get/mainwindow.cpp

@@ -11,6 +11,7 @@ MainWindow::MainWindow(QWidget *parent)
     ui->lineEdit_Torque->setText("35.0");
     ui->lineEdit_speedlimit->setText(QString::number(mfSpeedLimit));
     ui->lineEdit_torqueatlimit->setText(QString::number(mfTorqueAtLimit));
+    ui->lineEdit_TorqueStart->setText(QString::number(mfTorqueStart));
 
     mpa = iv::modulecomm::RegisterSend("torquebrake",1000,1);
     ModuleFun fungpsimu =std::bind(&MainWindow::UpdateGPSIMU,this,std::placeholders::_1,std::placeholders::_2,std::placeholders::_3,std::placeholders::_4,std::placeholders::_5);
@@ -40,6 +41,10 @@ void MainWindow::onTimer()
     {
         xtb.set_torque(mfTorque);
     }
+    if((mfSpeedNow<0.5) && (mfBrake == 0.0))
+    {
+        xtb.set_torque(mfTorqueStart);
+    }
     xtb.set_brake(mfBrake);
     xtb.set_enable(mbEnable);
 
@@ -81,6 +86,7 @@ void MainWindow::on_checkBox_clicked()
     mfBrake = ui->lineEdit_Brake->text().toDouble();
     mfSpeedLimit = ui->lineEdit_speedlimit->text().toDouble();
     mfTorqueAtLimit = ui->lineEdit_torqueatlimit->text().toDouble();
+    mfTorqueStart = ui->lineEdit_TorqueStart->text().toDouble();
 
 }
 

+ 1 - 0
src/tool/controller_torquebrake_get/mainwindow.h

@@ -42,6 +42,7 @@ private:
     bool mbEnable = false;
     double mfSpeedLimit = 30;
     double mfTorqueAtLimit = 30;
+    double mfTorqueStart = 100.0;
 
     double mfSpeedNow = 100.0;
 

+ 31 - 8
src/tool/controller_torquebrake_get/mainwindow.ui

@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>800</width>
-    <height>600</height>
+    <width>866</width>
+    <height>664</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -17,8 +17,8 @@
    <widget class="QPlainTextEdit" name="plainTextEdit">
     <property name="geometry">
      <rect>
-      <x>60</x>
-      <y>210</y>
+      <x>50</x>
+      <y>270</y>
       <width>531</width>
       <height>311</height>
      </rect>
@@ -64,7 +64,7 @@
     <property name="geometry">
      <rect>
       <x>620</x>
-      <y>260</y>
+      <y>296</y>
       <width>161</width>
       <height>51</height>
      </rect>
@@ -77,7 +77,7 @@
     <property name="geometry">
      <rect>
       <x>620</x>
-      <y>420</y>
+      <y>506</y>
       <width>161</width>
       <height>51</height>
      </rect>
@@ -136,7 +136,7 @@
     <property name="geometry">
      <rect>
       <x>60</x>
-      <y>151</y>
+      <y>156</y>
       <width>111</width>
       <height>31</height>
      </rect>
@@ -155,13 +155,36 @@
      </rect>
     </property>
    </widget>
+   <widget class="QLabel" name="label_5">
+    <property name="geometry">
+     <rect>
+      <x>60</x>
+      <y>210</y>
+      <width>131</width>
+      <height>30</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>起步扭矩</string>
+    </property>
+   </widget>
+   <widget class="QLineEdit" name="lineEdit_TorqueStart">
+    <property name="geometry">
+     <rect>
+      <x>200</x>
+      <y>210</y>
+      <width>131</width>
+      <height>31</height>
+     </rect>
+    </property>
+   </widget>
   </widget>
   <widget class="QMenuBar" name="menubar">
    <property name="geometry">
     <rect>
      <x>0</x>
      <y>0</y>
-     <width>800</width>
+     <width>866</width>
      <height>28</height>
     </rect>
    </property>