瀏覽代碼

delete test ui

jiaolili 3 年之前
父節點
當前提交
9266ae16d4

+ 1 - 0
src/v2x/CommunicatePlatform/main.cpp

@@ -5,6 +5,7 @@ int main(int argc, char *argv[])
 {
     QApplication a(argc, argv);
     MainWindow w;
+    w.setWindowTitle("Communicate Platform");
     w.show();
 
     return a.exec();

+ 8 - 127
src/v2x/CommunicatePlatform/mainwindow.cpp

@@ -140,89 +140,17 @@ void MainWindow::initMemory()
     m_structMGpsImu.accy=0.0;
 }
 
-void MainWindow::on_pushButton_connect_clicked()
-{
-    if(ui->pushButton_connect->text() == tr("connect")) {
-        enableTbox();
-        //修改按键文字
-        ui->pushButton_connect->setText("disconnect");
-    } else {
-        disableTbox();
-        //修改按键文字
-        ui->pushButton_connect->setText("connect");
-    }
-}
 
-void MainWindow::on_pushButton_vinChange_clicked()
-{
-        std::string str=ui->lineEdit_VIN->text().toStdString();
-        m_tbox->setTboxNewVin(str);
-        m_radio->setVin(str);
-}
-void MainWindow::on_checkBox_trafficBroadcast_stateChanged(int arg1)
-{
-    if(arg1==2) {
-        m_radio->getTrafficBroadcast(true);
-    } else {
-        m_radio->getTrafficBroadcast(false);
-    }
-}
 
-void MainWindow::on_checkBox_collisionWarning_stateChanged(int arg1)
-{
-    if(arg1==2) {
-        m_radio->getCollisonWarning(true);
-    } else {
-        m_radio->getCollisonWarning(false);
-    }
-}
 
-void MainWindow::on_checkBox_busyRoad_stateChanged(int arg1)
-{
-    if(arg1==2) {
-        m_radio->getBusyRoad(true);
-    } else {
-        m_radio->getBusyRoad(false);
-    }
-}
 
-void MainWindow::on_checkBox_dangerousDrive_stateChanged(int arg1)
-{
-    if(arg1==2) {
-        m_radio->getDangerDrive(true);
-    } else {
-        m_radio->getDangerDrive(false);
-    }
-}
 
-void MainWindow::on_pushButton_setVirtualVehicle_clicked()
-{
-    int virtualVehicleNum=ui->lineEdit_virtualVehicleNum->text().toInt();
-    double latMax=ui->lineEdit_latMax->text().toDouble();
-    double latMin=ui->lineEdit_latMin->text().toDouble();
-    double lngMax=ui->lineEdit_lngMax->text().toDouble();
-    double lngMin=ui->lineEdit_lngMin->text().toDouble();
-    float speedMax=ui->lineEdit_speedMax->text().toFloat();
-    float speedMin=ui->lineEdit_speedMin->text().toFloat();
-    float yawMax=ui->lineEdit_yawMax->text().toFloat();
-    float yawMin=ui->lineEdit_yawMin->text().toFloat();
-    int randId=qrand()%10000;
-    m_vectorRandom.push_back(randId);
-    virtualVehicleM structVirtualVehicle;
-    for(int i=1;i<virtualVehicleNum;i++) {
-        getRandomNum();
-    }
-    for(int i=0;i<virtualVehicleNum;i++) {
-        structVirtualVehicle.vin = m_vectorVin[i];
-        structVirtualVehicle.gps_lat=latMin+((double(m_vectorRandom[i]))/10000.0)*(latMax-latMin);
-        structVirtualVehicle.gps_lng=lngMin+((double(m_vectorRandom[i]))/10000.0)*(lngMax-lngMin);
-        structVirtualVehicle.speed=speedMin+((float(m_vectorRandom[i]))/10000.0)*(speedMax-speedMin);
-        structVirtualVehicle.yaw=yawMin+((float(m_vectorRandom[i]))/10000.0)*(yawMax-yawMin);
-        m_radio->upVirtualVehicle(structVirtualVehicle);
-    }
 
-    //m_radio
-}
+
+
+
+
+
 void MainWindow::getRandomNum()
 {
     int randId=qrand()%10000;
@@ -244,18 +172,7 @@ void MainWindow::setEnRadio(bool en)
     m_radio->setEnConnect(en);
 }
 
-void MainWindow::on_pushButton_radioConnect_clicked()
-{
-    if(ui->pushButton_radioConnect->text() == tr("connect")) {
-        setEnRadio(true);
-        //修改按键文字
-        ui->pushButton_radioConnect->setText("disconnect");
-    } else {
-        setEnRadio(false);
-        //修改按键文字
-        ui->pushButton_radioConnect->setText("connect");
-    }
-}
+
 //接收GPS数据
 void MainWindow::UpdateGPSIMU(const char * strdata,const unsigned int nSize,const unsigned int index,\
                               const QDateTime * dt,const char * strmemname)
@@ -523,45 +440,9 @@ unsigned char MainWindow::getError()
     }
 }
 
-void MainWindow::on_pushButton_clear_clicked()
-{
-    ui->textEdit->clear();
-}
 
-void MainWindow::on_pushButton_outLight_clicked()
-{
-    lightMessage light;
-    light.lightType=0x01;
-    light.timeRemaining=30;
-    m_radio->outLight(light);
-}
 
-void MainWindow::on_pushButton_warning_clicked()
-{
-    collisionEarlyWarningMessage warning;
-    warning.warningType=0x01;
-    warning.speedLimit=3;
-    m_radio->outCollisionWarning(warning);
-}
 
-void MainWindow::on_pushButton_realTimeMessage_clicked()
-{
-//    realtimeTrafficMessage realtime;
-//    realtime.lat=39*1000000;
-//    realtime.lng=137*1000000;
-//    realtime.scope=100;
-//    realtime.trafficInfo=0x01;
-//    realtime.speedLimit=0xFF;
-//    m_radio->outRealtimeTraffic(realtime);
-    collisionEarlyWarningMessage warning;
-    warning.warningType=0x02;
-    warning.speedLimit=0;
-    m_radio->outCollisionWarning(warning);
-}
 
-void MainWindow::on_pushButton_busy_clicked()
-{
-    congestionIdentificationMessage identi;
-    identi.openCommand=0x01;
-    m_radio->outCongestionIdenti(identi);
-}
+
+

+ 4 - 13
src/v2x/CommunicatePlatform/mainwindow.h

@@ -67,19 +67,10 @@ public:
     void UpdateState(const char * strdata,const unsigned int nSize,const unsigned int index,\
                                   const QDateTime * dt,const char * strmemname);
 private slots:
-    void on_pushButton_connect_clicked();
-    void on_pushButton_vinChange_clicked(); 
-    void on_checkBox_trafficBroadcast_stateChanged(int arg1);
-    void on_checkBox_collisionWarning_stateChanged(int arg1);
-    void on_checkBox_busyRoad_stateChanged(int arg1);
-    void on_checkBox_dangerousDrive_stateChanged(int arg1);
-    void on_pushButton_setVirtualVehicle_clicked();
-    void on_pushButton_radioConnect_clicked();
-    void on_pushButton_clear_clicked();
-    void on_pushButton_outLight_clicked();
-    void on_pushButton_warning_clicked();
-    void on_pushButton_realTimeMessage_clicked();
-    void on_pushButton_busy_clicked();
+
+
+
+
 };
 
 #endif // MAINWINDOW_H

+ 16 - 484
src/v2x/CommunicatePlatform/mainwindow.ui

@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>1019</width>
-    <height>603</height>
+    <width>362</width>
+    <height>294</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -17,7 +17,7 @@
    <widget class="QLabel" name="label">
     <property name="geometry">
      <rect>
-      <x>350</x>
+      <x>20</x>
       <y>40</y>
       <width>81</width>
       <height>31</height>
@@ -30,7 +30,7 @@
    <widget class="QLineEdit" name="lineEdit_enableTox">
     <property name="geometry">
      <rect>
-      <x>430</x>
+      <x>100</x>
       <y>50</y>
       <width>113</width>
       <height>25</height>
@@ -40,8 +40,8 @@
    <widget class="QLabel" name="label_2">
     <property name="geometry">
      <rect>
-      <x>680</x>
-      <y>40</y>
+      <x>20</x>
+      <y>170</y>
       <width>81</width>
       <height>31</height>
      </rect>
@@ -53,9 +53,9 @@
    <widget class="QLineEdit" name="lineEdit_enableRadio">
     <property name="geometry">
      <rect>
-      <x>760</x>
-      <y>50</y>
-      <width>113</width>
+      <x>100</x>
+      <y>180</y>
+      <width>111</width>
       <height>25</height>
      </rect>
     </property>
@@ -66,489 +66,28 @@
    <widget class="QGroupBox" name="groupBox">
     <property name="geometry">
      <rect>
-      <x>340</x>
+      <x>10</x>
       <y>20</y>
-      <width>311</width>
-      <height>501</height>
+      <width>321</width>
+      <height>91</height>
      </rect>
     </property>
     <property name="title">
      <string>Tbox</string>
     </property>
-    <widget class="QPushButton" name="pushButton_connect">
-     <property name="geometry">
-      <rect>
-       <x>20</x>
-       <y>420</y>
-       <width>89</width>
-       <height>25</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string>connect</string>
-     </property>
-    </widget>
-    <widget class="QPushButton" name="pushButton_vinChange">
-     <property name="geometry">
-      <rect>
-       <x>20</x>
-       <y>460</y>
-       <width>91</width>
-       <height>25</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string>VIN SET</string>
-     </property>
-    </widget>
-    <widget class="QLineEdit" name="lineEdit_VIN">
-     <property name="geometry">
-      <rect>
-       <x>120</x>
-       <y>460</y>
-       <width>181</width>
-       <height>25</height>
-      </rect>
-     </property>
-    </widget>
    </widget>
    <widget class="QGroupBox" name="groupBox_2">
     <property name="geometry">
      <rect>
-      <x>670</x>
-      <y>20</y>
+      <x>10</x>
+      <y>150</y>
       <width>321</width>
-      <height>501</height>
+      <height>81</height>
      </rect>
     </property>
     <property name="title">
      <string>电台</string>
     </property>
-    <widget class="QLabel" name="label_4">
-     <property name="geometry">
-      <rect>
-       <x>20</x>
-       <y>150</y>
-       <width>101</width>
-       <height>17</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string>路况信息广播:</string>
-     </property>
-    </widget>
-    <widget class="QLabel" name="label_5">
-     <property name="geometry">
-      <rect>
-       <x>20</x>
-       <y>180</y>
-       <width>101</width>
-       <height>17</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string>路口碰撞预警:</string>
-     </property>
-    </widget>
-    <widget class="QLabel" name="label_6">
-     <property name="geometry">
-      <rect>
-       <x>20</x>
-       <y>210</y>
-       <width>101</width>
-       <height>17</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string>交通拥堵识别:</string>
-     </property>
-    </widget>
-    <widget class="QLabel" name="label_7">
-     <property name="geometry">
-      <rect>
-       <x>20</x>
-       <y>450</y>
-       <width>101</width>
-       <height>17</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string>危险驾驶识别:</string>
-     </property>
-    </widget>
-    <widget class="QCheckBox" name="checkBox_trafficBroadcast">
-     <property name="geometry">
-      <rect>
-       <x>140</x>
-       <y>150</y>
-       <width>92</width>
-       <height>23</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string>开启</string>
-     </property>
-    </widget>
-    <widget class="QCheckBox" name="checkBox_collisionWarning">
-     <property name="geometry">
-      <rect>
-       <x>140</x>
-       <y>180</y>
-       <width>92</width>
-       <height>23</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string>开启</string>
-     </property>
-    </widget>
-    <widget class="QCheckBox" name="checkBox_busyRoad">
-     <property name="geometry">
-      <rect>
-       <x>140</x>
-       <y>210</y>
-       <width>92</width>
-       <height>23</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string>开启</string>
-     </property>
-    </widget>
-    <widget class="QCheckBox" name="checkBox_dangerousDrive">
-     <property name="geometry">
-      <rect>
-       <x>140</x>
-       <y>450</y>
-       <width>92</width>
-       <height>23</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string>开启</string>
-     </property>
-    </widget>
-    <widget class="QPushButton" name="pushButton_setVirtualVehicle">
-     <property name="geometry">
-      <rect>
-       <x>220</x>
-       <y>210</y>
-       <width>89</width>
-       <height>25</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string>set</string>
-     </property>
-    </widget>
-    <widget class="QLineEdit" name="lineEdit_virtualVehicleNum">
-     <property name="geometry">
-      <rect>
-       <x>110</x>
-       <y>250</y>
-       <width>51</width>
-       <height>25</height>
-      </rect>
-     </property>
-    </widget>
-    <widget class="QLabel" name="label_8">
-     <property name="geometry">
-      <rect>
-       <x>20</x>
-       <y>250</y>
-       <width>81</width>
-       <height>17</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string>仿真车数量:</string>
-     </property>
-    </widget>
-    <widget class="QLineEdit" name="lineEdit_latMin">
-     <property name="geometry">
-      <rect>
-       <x>90</x>
-       <y>290</y>
-       <width>71</width>
-       <height>25</height>
-      </rect>
-     </property>
-    </widget>
-    <widget class="QLabel" name="label_9">
-     <property name="geometry">
-      <rect>
-       <x>20</x>
-       <y>290</y>
-       <width>81</width>
-       <height>17</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string>纬度min:</string>
-     </property>
-    </widget>
-    <widget class="QLineEdit" name="lineEdit_latMax">
-     <property name="geometry">
-      <rect>
-       <x>240</x>
-       <y>290</y>
-       <width>71</width>
-       <height>25</height>
-      </rect>
-     </property>
-    </widget>
-    <widget class="QLabel" name="label_10">
-     <property name="geometry">
-      <rect>
-       <x>170</x>
-       <y>290</y>
-       <width>81</width>
-       <height>17</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string>纬度max:</string>
-     </property>
-    </widget>
-    <widget class="QLineEdit" name="lineEdit_lngMax">
-     <property name="geometry">
-      <rect>
-       <x>240</x>
-       <y>330</y>
-       <width>71</width>
-       <height>25</height>
-      </rect>
-     </property>
-    </widget>
-    <widget class="QLabel" name="label_11">
-     <property name="geometry">
-      <rect>
-       <x>170</x>
-       <y>330</y>
-       <width>71</width>
-       <height>17</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string>经度max:</string>
-     </property>
-    </widget>
-    <widget class="QLineEdit" name="lineEdit_lngMin">
-     <property name="geometry">
-      <rect>
-       <x>90</x>
-       <y>330</y>
-       <width>71</width>
-       <height>25</height>
-      </rect>
-     </property>
-    </widget>
-    <widget class="QLabel" name="label_12">
-     <property name="geometry">
-      <rect>
-       <x>20</x>
-       <y>330</y>
-       <width>71</width>
-       <height>17</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string>经度min:</string>
-     </property>
-    </widget>
-    <widget class="QLineEdit" name="lineEdit_speedMax">
-     <property name="geometry">
-      <rect>
-       <x>240</x>
-       <y>370</y>
-       <width>71</width>
-       <height>25</height>
-      </rect>
-     </property>
-    </widget>
-    <widget class="QLabel" name="label_13">
-     <property name="geometry">
-      <rect>
-       <x>170</x>
-       <y>370</y>
-       <width>81</width>
-       <height>17</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string>车速max:</string>
-     </property>
-    </widget>
-    <widget class="QLineEdit" name="lineEdit_speedMin">
-     <property name="geometry">
-      <rect>
-       <x>90</x>
-       <y>370</y>
-       <width>71</width>
-       <height>25</height>
-      </rect>
-     </property>
-    </widget>
-    <widget class="QLabel" name="label_14">
-     <property name="geometry">
-      <rect>
-       <x>20</x>
-       <y>370</y>
-       <width>81</width>
-       <height>17</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string>车速min:</string>
-     </property>
-    </widget>
-    <widget class="QLineEdit" name="lineEdit_yawMin">
-     <property name="geometry">
-      <rect>
-       <x>90</x>
-       <y>410</y>
-       <width>71</width>
-       <height>25</height>
-      </rect>
-     </property>
-    </widget>
-    <widget class="QLabel" name="label_15">
-     <property name="geometry">
-      <rect>
-       <x>10</x>
-       <y>410</y>
-       <width>81</width>
-       <height>17</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string>航向角min:</string>
-     </property>
-    </widget>
-    <widget class="QLabel" name="label_16">
-     <property name="geometry">
-      <rect>
-       <x>170</x>
-       <y>410</y>
-       <width>81</width>
-       <height>17</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string>航向角max:</string>
-     </property>
-    </widget>
-    <widget class="QLineEdit" name="lineEdit_yawMax">
-     <property name="geometry">
-      <rect>
-       <x>250</x>
-       <y>410</y>
-       <width>71</width>
-       <height>25</height>
-      </rect>
-     </property>
-    </widget>
-    <widget class="QPushButton" name="pushButton_radioConnect">
-     <property name="geometry">
-      <rect>
-       <x>20</x>
-       <y>80</y>
-       <width>89</width>
-       <height>25</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string>connect</string>
-     </property>
-    </widget>
-   </widget>
-   <widget class="QTextEdit" name="textEdit">
-    <property name="geometry">
-     <rect>
-      <x>20</x>
-      <y>50</y>
-      <width>291</width>
-      <height>361</height>
-     </rect>
-    </property>
-   </widget>
-   <widget class="QPushButton" name="pushButton_clear">
-    <property name="geometry">
-     <rect>
-      <x>220</x>
-      <y>420</y>
-      <width>89</width>
-      <height>25</height>
-     </rect>
-    </property>
-    <property name="text">
-     <string>clear</string>
-    </property>
-   </widget>
-   <widget class="QLabel" name="label_3">
-    <property name="geometry">
-     <rect>
-      <x>20</x>
-      <y>20</y>
-      <width>121</width>
-      <height>17</height>
-     </rect>
-    </property>
-    <property name="text">
-     <string>共享内存数据:</string>
-    </property>
-   </widget>
-   <widget class="QPushButton" name="pushButton_outLight">
-    <property name="geometry">
-     <rect>
-      <x>30</x>
-      <y>460</y>
-      <width>89</width>
-      <height>25</height>
-     </rect>
-    </property>
-    <property name="text">
-     <string>light</string>
-    </property>
-   </widget>
-   <widget class="QPushButton" name="pushButton_realTimeMessage">
-    <property name="geometry">
-     <rect>
-      <x>28</x>
-      <y>510</y>
-      <width>101</width>
-      <height>31</height>
-     </rect>
-    </property>
-    <property name="text">
-     <string>real-time info</string>
-    </property>
-   </widget>
-   <widget class="QPushButton" name="pushButton_warning">
-    <property name="geometry">
-     <rect>
-      <x>190</x>
-      <y>460</y>
-      <width>89</width>
-      <height>25</height>
-     </rect>
-    </property>
-    <property name="text">
-     <string>warning</string>
-    </property>
-   </widget>
-   <widget class="QPushButton" name="pushButton_busy">
-    <property name="geometry">
-     <rect>
-      <x>190</x>
-      <y>510</y>
-      <width>89</width>
-      <height>25</height>
-     </rect>
-    </property>
-    <property name="text">
-     <string>busy road</string>
-    </property>
    </widget>
    <zorder>groupBox</zorder>
    <zorder>groupBox_2</zorder>
@@ -556,20 +95,13 @@
    <zorder>lineEdit_enableTox</zorder>
    <zorder>label_2</zorder>
    <zorder>lineEdit_enableRadio</zorder>
-   <zorder>textEdit</zorder>
-   <zorder>pushButton_clear</zorder>
-   <zorder>label_3</zorder>
-   <zorder>pushButton_outLight</zorder>
-   <zorder>pushButton_realTimeMessage</zorder>
-   <zorder>pushButton_warning</zorder>
-   <zorder>pushButton_busy</zorder>
   </widget>
   <widget class="QMenuBar" name="menuBar">
    <property name="geometry">
     <rect>
      <x>0</x>
      <y>0</y>
-     <width>1019</width>
+     <width>362</width>
      <height>22</height>
     </rect>
    </property>