Explorar o código

modify ui point2D to passPoint

HAPO-9# %!s(int64=4) %!d(string=hai) anos
pai
achega
2c09a7ef2a

+ 2 - 1
autogen.sh

@@ -200,6 +200,7 @@ done
 
 detect_app_name=(
 	detection_chassis
+	detection_lidar_grid
 )
 
 for x in ${detect_app_name[@]}
@@ -218,7 +219,7 @@ done
 
 
 fution_app_name=(
-	lidar_radar_fusion_cnn
+#	lidar_radar_fusion_cnn
 )
 
 for x in ${fution_app_name[@]}

+ 1 - 1
src/decition/common/common/car_status.h

@@ -217,7 +217,7 @@ namespace iv {
         int rsu_warnlimit_spd=200;  //200代表没有限速
         double rsu_gps_lat=0.0;
         double rsu_gps_lng=0.0;//中心点
-        int iTrafficeLightColor = 2;    //0x0: 红色
+        int iTrafficeLightColor = 3;    //0x0: 红色
         //0x1: 黄色
         //0x2: 绿色
         int vehicle_state_1x=0; //0正常行驶,1减速,2 停车

+ 25 - 16
src/ui/ui_ads_hmi_1px/ADCIntelligentVehicle.cpp

@@ -1036,7 +1036,7 @@ void ADCIntelligentVehicle::paintEvent(QPaintEvent *)
         navigation_data = m_navigation_data;
         mMutexNavi.unlock();
 
-        std::vector<iv::Point2D> myplan,myplan_left,myplan_right;
+        std::vector<iv::TracePoint> myplan,myplan_left,myplan_right;
         mMutexPlan.lock();
         myplan = m_plan;
         mMutexPlan.unlock();
@@ -1380,12 +1380,12 @@ void ADCIntelligentVehicle::UpdatePlanTrace(const char * strdata,const unsigned
 {
     mMutexPlan.lock();
     m_plan.clear();
-    int nplansize = nSize/sizeof(iv::Point2D);
-    int npsize = sizeof(iv::Point2D);
+    int nplansize = nSize/sizeof(iv::TracePoint);
+    int npsize = sizeof(iv::TracePoint);
     int i;
     for(i=0;i<nplansize;i++)
     {
-        iv::Point2D x;
+        iv::TracePoint x;
         memcpy(&x,strdata + i*npsize,npsize);
         m_plan.push_back(x);
     }
@@ -1396,15 +1396,15 @@ void ADCIntelligentVehicle::UpdatePlanTrace_left(const char * strdata,const unsi
 {
     mMutexPlan_left.lock();
     m_plan_left.clear();
-    int nplansize = nSize/sizeof(iv::Point2D);
+    int nplansize = nSize/sizeof(iv::TracePoint);
     if(nplansize < 1)
         std::cout<<"UpdatePlanTrace_left size is 0................. "<<std::endl;
-    //        return;
-    int npsize = sizeof(iv::Point2D);
+//        return;
+    int npsize = sizeof(iv::TracePoint);
     int i;
     for(i=0;i<nplansize;i++)
     {
-        iv::Point2D x;
+        iv::TracePoint x;
         memcpy(&x,strdata + i*npsize,npsize);
         m_plan_left.push_back(x);
     }
@@ -1415,14 +1415,14 @@ void ADCIntelligentVehicle::UpdatePlanTrace_right(const char * strdata,const uns
 {
     mMutexPlan_right.lock();
     m_plan_right.clear();
-    int nplansize = nSize/sizeof(iv::Point2D);
+    int nplansize = nSize/sizeof(iv::TracePoint);
     if(nplansize < 1)
         std::cout<<"UpdatePlanTrace_right size is 0................. "<<std::endl;
-    int npsize = sizeof(iv::Point2D);
+    int npsize = sizeof(iv::TracePoint);
     int i;
     for(i=0;i<nplansize;i++)
     {
-        iv::Point2D x;
+        iv::TracePoint x;
         memcpy(&x,strdata + i*npsize,npsize);
         m_plan_right.push_back(x);
     }
@@ -2110,12 +2110,21 @@ void ADCIntelligentVehicle::UpdateVbox(const char * strdata,const unsigned int n
 void ADCIntelligentVehicle::on_button_start_clicked()
 {
 #ifdef USE_PAD_CTRL
-    ServiceCarStatus.mbRunPause = false;
-    iv::hmi::HMIBasic hmi;
-    hmi.mbBocheMode = false;
-    hmi.mbPause = false;
-    ShareHMIMsg(hmi);
+    iv::hmi::hmimsg hmi;
+    if(mbPause){
+        ServiceCarStatus.mbRunPause = false;
+        hmi.set_mbpause(false);
+        mbPause = false;
+        ui->button_start->setText("暂停自动驾驶");
+    }else{
+        ServiceCarStatus.mbRunPause = true;
+        hmi.set_mbpause(true);
+        mbPause = true;
+        ui->button_start->setText("启动自动驾驶");
+    }
+    ShareHMIMsgPro(hmi);
     return;
+
 #endif
 }
 //云平台使能控制

+ 4 - 1
src/ui/ui_ads_hmi_1px/ADCIntelligentVehicle.h

@@ -49,6 +49,8 @@
 #include "common/obstacle_type.h"
 #include "common/constants.h"
 
+#include "../../../src/decition/common/common/tracepointstation.h"
+
 #include "modulecomm.h"
 
 #include <QMutex>
@@ -319,7 +321,7 @@ public:
     void UpdatePlanTrace(const char * strdata,const unsigned int nSize,const unsigned int index,const QDateTime * dt,const char * strmemname);
     void UpdatePlanTrace_left(const char * strdata,const unsigned int nSize,const unsigned int index,const QDateTime * dt,const char * strmemname);
     void UpdatePlanTrace_right(const char * strdata,const unsigned int nSize,const unsigned int index,const QDateTime * dt,const char * strmemname);
-    std::vector<iv::Point2D> m_plan,m_plan_left,m_plan_right;
+    std::vector<iv::TracePoint> m_plan,m_plan_left,m_plan_right;
     QMutex mMutexPlan,mMutexPlan_left,mMutexPlan_right;
 private:
     void * mpaplantrace;
@@ -368,6 +370,7 @@ private:
     int miIdentiStart= 255;//拥堵识别开启指令 1:开启 254:异常 255:无效
     int micarSt = 255;//路况信息执行动作
     float micarSpeedDis = 0.0;//当前车速目标
+    bool mbPause = true;//true:run false:stop
 
 public:
     void updateV2R(iv::v2r::v2r_send xv2rMsg);

+ 1 - 4
src/ui/ui_ads_hmi_1px/ADCIntelligentVehicle.ui

@@ -8357,7 +8357,7 @@ p, li { white-space: pre-wrap; }
         <string>激光显示</string>
        </property>
        <property name="checked">
-        <bool>false</bool>
+        <bool>true</bool>
        </property>
       </widget>
      </item>
@@ -8369,9 +8369,6 @@ p, li { white-space: pre-wrap; }
        <property name="text">
         <string>融合显示</string>
        </property>
-       <property name="checked">
-        <bool>true</bool>
-       </property>
       </widget>
      </item>
     </layout>

+ 15 - 0
src/ui/ui_ads_hmi_1px/main.cpp

@@ -10,6 +10,11 @@ iv::Ivlog * gIvlog;
 
 #include "xmlparam.h"
 
+#include "ivexit.h"
+#include <thread>
+
+QApplication * gApp;
+
 std::string gstrmemgps;
 std::string gstrmemradar;
 std::string gstrmemdecition;
@@ -19,12 +24,20 @@ std::string gstrvin;
 std::string gstrLat;
 std::string gstrLon;
 
+void ExitFunc()
+{
+    gApp->quit();
+    std::this_thread::sleep_for(std::chrono::milliseconds(900));
+}
+
 int main(int argc, char *argv[])
 {
     RegisterIVBackTrace();
     showversion("ui_ads_hmi");
     QApplication a(argc, argv);
 
+    gApp = &a;
+
     QString strpath = QCoreApplication::applicationDirPath();
 
    if(argc < 2)
@@ -63,5 +76,7 @@ int main(int argc, char *argv[])
 //    w.showMinimized();  //apollo_fu 20200413
     w.showMaximized();
 
+    iv::ivexit::RegIVExitCall(ExitFunc);
+
     return a.exec();
 }